Description
Right now MSBuildLocator.RegisterDefaults registers the first instance it finds on the machine, whatever that is:
This provides to be wrong in a lot of cases: for example, any tool using RegisterDefaults won't be able to analyze the Roslyn solution on a machine with both VS2017 and VS2019. RegisterDefaults will pick the 2017 version, which will break because we're using the new "GetPathsOfAllDirectoriesAbove" feature which doesn't exist in 2017. Just yesterday both I and @sharwell were independently replacing this in two separate tools with the exact same PR:
dotnet/roslyn#40886
dotnet/roslyn@43e13de
Should this just be the automatic behavior? Because .editorconfig support uses this new MSBuild feature, anybody using any tool using the default function that has both VS2017 and VS2019 on their machine is going to get potentially very unexpected results.