only select MSBuild from VS if .NET SDK Resolvers are present #1845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an aggressive change, similar to when we dropped VS < 16.3 to support .NET core better, one that I believe is necessary to improve user experience.
We will no longer select MSBuild from VS instance, if that instance doesn't have .NET SDK resolvers. The rationale is that vast majority of users want to use new SDK based projects, and not having it along the selected MSBuild instance currently leads into a broken state without much info of what went wrong.
If someone is negatively affected - doesn't need .NET SDK (old style projects, unity) and now gets shifted to stand alone instance, they can still use the MSBuild override feature. This is similar to what we recommended to VS 2017 users back in the day.
Additionally, I improved the warning messages:
Hopefully this will improve the ability for users to "self troubleshoot" the issues.
Fixes #1842
Fixes #1730
and several other
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found.
on Windows.