What is Microsoft.Build.Locator for?
mainMicrosoft.Build.Locator is used to correctly load MSBuild projects (such as .csproj, .vbproj, .fsproj, .sqlproj, and .ccproj) by locating a valid MSBuild installation on the host machine.
While MSBuild can be provided via NuGet packages, loading complex projects requires access to the SDKs and build logic distributed with Visual Studio, Visual Studio extensions, or the .NET SDK. Using the Locator ensures your application uses the same MSBuild context as MSBuild.exe, dotnet build, or Visual Studio, providing access to the same bug fixes, features, and performance improvements.