Skip to content

Fix UsingTask order for VS 17.12 #647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2025
Merged

Conversation

mcarton
Copy link
Contributor

@mcarton mcarton commented Jan 22, 2025

The MSBuild task is currently not working, and fails with runtime errors.

As per
https://learn.microsoft.com/en-us/visualstudio/msbuild/usingtask-element-msbuild?view=vs-2022:

Unlike properties and items, the first UsingTask element that applies to a
TaskName will be used; to override tasks you must define a new UsingTask
before the existing one, or specify Override="true" in the new UsingTask.

Therefore when using Visual Studio 17.12, .NET 8 was picked instead of .NET 9, as the task/condition for .NET 8 also matched and came first.

This was broken in a69773a, before that, the conditions had upper bounds.

As per
https://learn.microsoft.com/en-us/visualstudio/msbuild/usingtask-element-msbuild?view=vs-2022:

> Unlike properties and items, the first `UsingTask` element that applies to a
> `TaskName` will be used; to override tasks you must define a new `UsingTask`
> before the existing one, or specify `Override="true"` in the new `UsingTask`.

Therefore when using Visual Studio 17.12 .NET 8 was picked instead of .NET 9,
as the task/condition for .NET 8 also matched and came first.

This was broken in a69773a, before
that, the conditions had upper bounds.
@mruxmohan4
Copy link
Contributor

Thank you for catching and resolving this issue!

@mruxmohan4 mruxmohan4 enabled auto-merge (squash) January 22, 2025 19:35
@mruxmohan4 mruxmohan4 merged commit 17c8e28 into microsoft:main Jan 22, 2025
5 checks passed
@mcarton mcarton deleted the bugfix/versions branch January 22, 2025 19:46
@mcarton
Copy link
Contributor Author

mcarton commented Jan 22, 2025

@mruxmohan4 thank you for merging this so quickly. Would you mind making a new release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants