Buildalyzer
Buildalyzer copied to clipboard
Buildalizer chooses MSBuild without .NET components
I have the following Visual Studio installations:
- Visual Studio 2019 (with .NET components)
- Visual Studio Build Tools 2019 (with C++ components only)
Buildalizer chooses VS Build Tools 2019
installation to run msbuild. Since it has no .NET components, the build fails. Installing .NET components to that installation fixes the problem. But maybe it's possible to choose the appropriate installation by a Buildalizer itself?
What an interesting scenario. It never occurred to me this might be a problem, but it makes total sense. I guess the challenge is knowing which one to pick - I.e. if it were reversed and the VS Build Tools had the .NET components but the VS install only had C++, how would we know?
vswhere
allows to search for VS installation with required components: https://github.com/microsoft/vswhere
I guess it can be used to find appropriate installation. It's a part of VS Installer, so it's possible to call it from there. Also, it looks like there is an option to distribute vswhere as a part of Buildalizer.
@daveaglick @Inok is there a plan to fix this issue ? we are using this project for building another tool and would be happy to contribute and fix if not fixed yet....
How about https://github.com/microsoft/MSBuildLocator
What is Locator for? MSBuild offers a .NET API surface that allows you to evaluate and build MSBuild projects from an application.
Loading MSBuild from Visual Studio also ensures that your application gets the same view of projects as MSBuild.exe, dotnet build, or Visual Studio, including bug fixes, feature additions, and performance improvements that may come from a newer MSBuild release.