VOOZH about

URL: https://www.nuget.org/packages/Microsoft.Build.Locator/

⇱ NuGet Gallery | Microsoft.Build.Locator 1.11.2




👁 Image
Microsoft.Build.Locator 1.11.2

Prefix Reserved
dotnet add package Microsoft.Build.Locator --version 1.11.2
 
 
NuGet\Install-Package Microsoft.Build.Locator -Version 1.11.2
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Build.Locator" Version="1.11.2" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Build.Locator" Version="1.11.2" />
 
Directory.Packages.props
<PackageReference Include="Microsoft.Build.Locator" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Build.Locator --version 1.11.2
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Microsoft.Build.Locator, 1.11.2"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Build.Locator@1.11.2
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Build.Locator&version=1.11.2
 
Install as a Cake Addin
#tool nuget:?package=Microsoft.Build.Locator&version=1.11.2
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Microsoft.Build.Locator

Microsoft.Build.Locator helps you locate and register MSBuild assemblies provided with Visual Studio or the .NET SDK. This is essential when you need to use MSBuild APIs in your application to evaluate or build projects.

Why do I need this?

When using MSBuild's .NET API to load and build projects, you need access to the SDKs and build logic distributed with Visual Studio or the .NET SDK, not just the MSBuild APIs. MSBuildLocator helps you find these installations and set up your application to use them, ensuring your code gets the same view of projects as MSBuild.exe, dotnet build, or Visual Studio.

Quick Start

Before using any MSBuild APIs, register MSBuild assemblies:

using Microsoft.Build.Locator;
using Microsoft.Build.Evaluation;

// Register defaults before using any MSBuild types
MSBuildLocator.RegisterDefaults();

// Now you can safely use MSBuild APIs.
// NOTE: due the the way that the CLR loads assemblies, you MUST
// register MSBuild through Locator before any types from 
// the MSBuild assemblies are used in your application.
// The safest way to ensure this is to put any MSBuild API
// access into a separate method.
LoadProject();

void LoadProject()
{
 var project = new Project("MyProject.csproj");
 ...
}

For more control over which MSBuild instance to use:

using Microsoft.Build.Locator;

// Query available MSBuild instances
var instances = MSBuildLocator.QueryVisualStudioInstances().ToArray();

// Register a specific instance
var instance = instances.OrderByDescending(i => i.Version).First();
MSBuildLocator.RegisterInstance(instance);

Documentation

For complete documentation, see Use Microsoft.Build.Locator on Microsoft Learn.

Samples

See the BuilderApp sample for a full exploration of the MSBuildLocator library and capabilities.

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Framework net46 net46 is compatible.  net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (102)

Showing the top 5 NuGet packages that depend on Microsoft.Build.Locator:

Package Downloads
Nuke.ProjectModel

The AKEless Build System for C#/.NET Signed by signpath.io from repository 'https://github.com/nuke-build/nuke' commit '8aaec258a7e00e5d98e013be025db1a42bc58d79' (see contained AppVeyorSettings.json file for build settings).

Rocket.Surgery.Nuke

Package Description

FSharpLint.Core

API to programmatically run FSharpLint.

Microsoft.DocAsCode.Metadata.ManagedReference

Package Description

PostSharp.Engineering.BuildTools

A multi-repo build orchestrator used by PostSharp Technologies for its products and for Metalama.

GitHub repositories (103)

Showing the top 20 popular GitHub repositories that depend on Microsoft.Build.Locator:

Repository Stars
dotnet/roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
stride3d/stride
Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
xamarin/Xamarin.Forms
Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
tModLoader/tModLoader
A mod to make and play Terraria mods. Supports Terraria 1.4 (and earlier) installations
dotnet/tye
Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
dotnet/Silk.NET
The high-speed OpenGL, OpenCL, OpenAL, OpenXR, GLFW, SDL, Vulkan, Assimp, WebGPU, and DirectX bindings library your mother warned you about.
grpc/grpc-dotnet
gRPC for .NET
scriban/scriban
A fast, powerful, safe and lightweight scripting language and engine for .NET
thomhurst/TUnit
A modern, fast and flexible .NET testing framework
MattParkerDev/SharpIDE
A modern, cross platform IDE for .NET, built with .NET & Godot
nuke-build/nuke
🏗 The AKEless Build System for C#/.NET
dotnet/samples
Sample code referenced by the .NET documentation
martinothamar/Mediator
A high performance implementation of Mediator pattern in .NET using source generators.
dafny-lang/dafny
Dafny is a verification-aware programming language
dotnet/roslynator
Roslynator is a set of code analysis tools for C#, powered by Roslyn.
waf/CSharpRepl
A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.
coverlet-coverage/coverlet
Cross platform code coverage for .NET
dotnet/sdk
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
mono/monodevelop
MonoDevelop is a cross platform .NET IDE
DotNetAnalyzers/StyleCopAnalyzers
An implementation of StyleCop rules using the .NET Compiler Platform
Version Downloads Last Updated
1.11.2 629,593 11/25/2025
1.11.1 23,968 11/18/2025
1.10.12 206,131 11/6/2025
1.10.2 177,955 10/4/2025
1.9.1 1,341,335 3/31/2025
1.8.1 90,330 3/31/2025
1.7.8 97,987,089 3/14/2024
1.7.1 261,917 2/6/2024
1.6.10 4,801,738 9/20/2023
1.6.1 112,966 8/30/2023
1.5.32-g4ed1bab6ff 716 8/25/2023
1.5.6 10,775 8/29/2023
1.5.5 3,758,582 9/6/2022
1.5.3 85,458 8/11/2022
1.4.10-g38d95f4814 1,622 8/8/2022
1.4.6-g7150a203a1 1,062 8/5/2022
1.4.1 39,556,725 1/21/2021
1.3.2 61,510 12/17/2020
1.2.15-ge4e3fc36c9 1,533 11/9/2020
1.2.6 2,323,636 8/14/2019
Loading failed