An API to locate MSBuild assemblies from an installed Visual Studio location. Use this to ensure that calling the MSBuild API will use the same toolset that a build from Visual Studio or msbuild.exe would.
Other
212
stars
83
forks
source link
Allow finding Visual Studio installs on Windows on .NET 6+. #207
This is a very important use-case for me, because the .NET SDKs can't process .vcxproj files but Visual Studio can, so being unable to locate Visual Studio build tools at all means I can't run my app on .NET. I think it makes sense to change this given that the readme file explicitly talks about it not being enough to load some projects, so allowing more users to load more projects seems to fit with the project's ethos.
I've tested this on Windows, and it works perfectly for my use-case. Unfortunately I don't have access to other supported .NET platforms, but I'm fairly confident it'll work correctly - GetDevConsoleInstance has all the APIs available but will certainly return null, and VisualStudioLocationHelper.GetInstances will catch a DllNotFoundException and continue, so the end result should be the same.
This is a very important use-case for me, because the .NET SDKs can't process
.vcxproj
files but Visual Studio can, so being unable to locate Visual Studio build tools at all means I can't run my app on .NET. I think it makes sense to change this given that the readme file explicitly talks about it not being enough to load some projects, so allowing more users to load more projects seems to fit with the project's ethos.I've tested this on Windows, and it works perfectly for my use-case. Unfortunately I don't have access to other supported .NET platforms, but I'm fairly confident it'll work correctly -
GetDevConsoleInstance
has all the APIs available but will certainly returnnull
, andVisualStudioLocationHelper.GetInstances
will catch aDllNotFoundException
and continue, so the end result should be the same.