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
216
stars
83
forks
source link
Migrate .NET (Core) discovery to hosting layer APIs #111
Currently we enumerate .NET SDK instances by spawning dotnet --info and parsing the textual output. But that's inefficient and it turns out there are APIs designed for almost exactly the situations we have, including global.json handling:
Specifically, Locator should call hostfxr_resolve_sdk2 to get the highest-priority/default SDK, and hostfxr_get_available_sdks to populate the full list.
Currently we enumerate .NET SDK instances by spawning
dotnet --info
and parsing the textual output. But that's inefficient and it turns out there are APIs designed for almost exactly the situations we have, includingglobal.json
handling:https://github.com/dotnet/runtime/blob/6072e4d3a7a2a1493f514cdf4be75a3d56580e84/docs/design/features/hosting-layer-apis.md
Specifically, Locator should call
hostfxr_resolve_sdk2
to get the highest-priority/default SDK, andhostfxr_get_available_sdks
to populate the full list.