Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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.

License

NotificationsYou must be signed in to change notification settings

microsoft/MSBuildLocator

Repository files navigation

What is Locator for?

MSBuild offers a .NET API surface that allows you toevaluate andbuild MSBuild projects from an application. MSBuild is available as a set of NuGet packages that can provide the implementation of the MSBuild programming language to your application. But it's generally not enough to be able to loadsome MSBuild project: you want your application to be able to load the.csproj,.vbproj,.fsproj,.sqlproj,.ccproj and other project types that you can build in Visual Studio (or Visual Studio Build Tools) or with the .NET SDK. To do that, you need more than just MSBuild's assemblies--you must also have access to all of the SDKs and build logic that are imported into those projects.

That additional build logic is distributed with Visual Studio, with Visual Studio extensions, or as part of the .NET SDK. So to correctly load projects, you need to load them in the context of one of those MSBuild installations.

Loading MSBuild from Visual Studio also ensures that your application gets the same view of projects asMSBuild.exe,dotnet build, or Visual Studio, including bug fixes, feature additions, and performance improvements that may come from a newer MSBuild release.

How Locator searches for .NET SDK?

MSBuild.Locator searches for the locally installed SDK based on the following priority:

  1. DOTNET_ROOT
  2. Current process path if MSBuild.Locator is called from dotnet.exe
  3. DOTNET_HOST_PATH
  4. DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
  5. PATH

Note that probing stops when the first dotnet executable is found among the listed variables.

Documentation describing the definition of these variables can be found here:.NET Environment Variables.

Documentation

Documentation is located on the official Microsoft documentation site:Use Microsoft.Build.Locator.

Build status

CI status:Build and test

Official build:Build Status

Contributing

This project has adopted theMicrosoft Open Source Code of Conduct. For more information see theCode of Conduct FAQ or contactopencode@microsoft.com with any additional questions or comments.

About

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.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors33

Languages


[8]ページ先頭

©2009-2025 Movatter.jp