Open-source project
dotnet/msbuild avatar
dotnet/msbuild

MSBuild: the XML build engine behind .NET and Visual Studio

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.

5,554 stars1,463 forksC#MIT

At a glance

What is it?
MSBuild is the build platform for .NET and Visual Studio, and it runs without the IDE. This article covers the project file schema, the command line entry point, how to build the engine from source, and where the tool is the wrong choice.
Who is it for?
Adopt MSBuild if you build .NET projects and need the build to run outside Visual Studio, on a build server or in a script, or if you need to extend a build with your own tasks and loggers. Do not adopt it as a general-purpose build system for a repository that has no .NET or Visual Studio content, and do not expect the source-built bootstrap copy to cover every scenario: the README states it may not work for all scenarios, including C++ builds.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • dotnet/msbuild5,554 ★ · +3
Star history
Repository2026-09-232026-11-13
dotnet/msbuild5.6k5.6k

3 Stars in the last 51 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What MSBuild is for, and who ends up using it

MSBuild is a build engine with an XML schema for project files. The README describes it as "a platform for building applications" where that XML schema "controls how the build platform processes and builds software." That sentence is the whole design: the engine is general, and the project file tells it what to do. Visual Studio uses MSBuild, but the README is explicit that MSBuild runs without Visual Studio. Invoking msbuild.exe on a project or solution file is how you "orchestrate and build products in environments where Visual Studio isn't installed."

The people who end up reading this repository are not usually the people who write .NET code. They are the ones who inherit a build. A CI pipeline that needs to run the same steps a developer runs locally. A packaging step that has to call into a project file rather than reimplement it. Someone writing a custom task or logger because the shipped ones do not emit the shape of data they need. The README lists the component split that these users touch: Microsoft.Build.CommandLine is the MSBuild.exe entry point, Microsoft.Build gives programmatic access to and control of the engine, Microsoft.Build.Framework defines how tasks and loggers interact with the engine, Microsoft.Build.Tasks implements the tasks that ship with MSBuild, and Microsoft.Build.Utilities provides helper classes for writing your own loggers and tasks.

That split matters. If you only ever call msbuild.exe from a script, you live in the CommandLine component and never touch the API surface. If you are writing a task, you reference Microsoft.Build.Utilities and Microsoft.Build.Framework, not the engine itself. Knowing which assembly you need saves a lot of guessing.

The XML schema, targets, and the task and logger boundary

The mechanism is a two-layer indirection. A project file is XML. The engine reads it, evaluates properties and items, and then executes targets. Targets contain tasks, and tasks are the units that actually do work. The README does not spell out the evaluation order, but it does name the boundary that matters most for extension: Microsoft.Build.Framework "contains the types that define how tasks and loggers interact with the MSBuild engine." Tasks do work, loggers observe it, and both talk to the engine through that framework rather than through each other.

The consequence is that a build is inspectable in a way a shell script is not. Every target has a name, every task has parameters, and every logger sees the same event stream. If you have ever needed to know why a file was copied twice, that structure is the answer: you can name the target and see it run. The cost is that XML is a poor programming language. Conditions are strings, loops are item batching, and the same logic expressed in a script becomes a page of elements. MSBuild accepts this trade because the file has to be readable by the IDE as well as the engine.

The component list also explains why custom loggers are a realistic option rather than a curiosity. Microsoft.Build.Utilities exists specifically to provide helper classes for creating your own loggers and tasks, so the supported path for getting different output is to write a logger, not to parse stdout.

Installing MSBuild and running a first build from the command line

MSBuild ships two ways in practice: inside Visual Studio, and inside the .NET SDK. The repository README does not give an install command for either; it points to the MSBuild documentation on learn.microsoft.com for information about MSBuild generally. So the honest answer to "how do I install MSBuild" is that you install the thing that carries it, and the README only documents how to build the engine itself from source.

The source build on Windows is the path the README does document. It requires Visual Studio 2026 with the .NET desktop development workload, plus .NET Framework 3.5, plus long path support enabled at the Windows level. The README states that a full MSBuild build includes outputs that require .NET Framework 3.5. From a Developer Command Prompt for VS 2026, clone and build:

bash
git clone https://github.com/dotnet/msbuild
cd msbuild
.\build.cmd

Running build.cmd from the repository root builds the code and restores the packages needed to open the projects in Visual Studio. The README says the resulting engine lands at artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\MSBuild.exe. Note the caveat in the README: this newly built MSBuild "may not work for all scenarios, including C++ builds." That is a bootstrap copy for development, not a replacement for the installed toolchain.

On Unix, the README does not give steps inline. It directs readers to the wiki page documentation/wiki/Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md, and states that MSBuild can be run on Unix systems that support .NET Core. There is a build.sh at the repository root, but the README does not describe its arguments, so do not assume it mirrors build.cmd.

For localization, the README gives one flag. A localized build is turned on with /p:LocalizedBuild=true passed on the command line. That is a property, not a switch, and it goes through the same property mechanism as any other build property.

Where MSBuild is the wrong tool

The README's own caveat about the bootstrap build is the clearest limitation: a source-built MSBuild "may not work for all scenarios, including C++ builds." If your build depends on C++ targets, the documented source-build path is not a supported substitute for the installed engine.

There is a second, quieter limitation. The README frames MSBuild around Visual Studio and .NET: it is the build platform for both, and the documented build requirements are Visual Studio 2026 workloads plus .NET Framework 3.5. Nothing in the README suggests the project positions itself as a general build system for arbitrary languages. Adopting it for a polyglot repository means writing targets to shell out to whatever actually compiles each language, at which point you have added a layer rather than removed one.

The third limitation is the one that bites teams on upgrade: the README does not document rollback. If you move to a new MSBuild and a target breaks, the documentation in this repository does not describe how to revert. That is not a criticism of the engine so much as a gap in what the README covers, and it is worth knowing before you pin a build server to a specific drop.

Finally, the entry point itself is a source of ambiguity. There is msbuild.exe from Visual Studio and there is the MSBuild that comes with the .NET SDK, and they are not the same binary. The README does not reconcile them. If a build behaves differently on a developer machine than on a build agent, that difference is the first thing to check.

MSBuild versus dotnet build

The frequent comparison is msbuild versus dotnet build, and the difference is in what each one is. MSBuild is the engine. dotnet build is a driver: it locates a project, resolves the SDK, and then invokes MSBuild against it. When you run dotnet build you are still running MSBuild, just with the SDK's defaults applied and with the SDK's copy of the engine selected for you.

That distinction decides which one to reach for. If you want the SDK's conventions, the current SDK's MSBuild, and a command that works the same on Linux, macOS and Windows, dotnet build is the shorter path. If you need to pass engine-level switches, select a specific MSBuild, or build a project that is not SDK-style, you go to msbuild.exe directly. The README supports this reading: it describes invoking msbuild.exe on a project or solution file as the way to build where Visual Studio is not installed, and it does not present dotnet build as an alternative entry point at all.

The practical trap is mixing them. Calling dotnet build in one CI step and msbuild.exe in another can select two different engines with two different sets of targets, and the failure shows up as a target that exists in one and not the other. Pick one entry point per pipeline and stay with it.

Maintenance, release cadence and the MIT licence

The repository is not archived, and the last push was on 2026-11-02. The release list shows a steady cadence: v18.9.6 on 2026-08-11, v18.10.1 on 2026-09-08, and v18.11.0 on 2026-10-15. That is roughly monthly, and the README points to documentation/Changelog.md for detailed information about changes made in different releases. Upgrade cost therefore tracks the changelog rather than a migration guide, and the changelog is the file to read before moving a build server to a new drop.

Contributing has a defined entry point. The README lists a Contributing Guide at documentation/wiki/Contributing-Code.md and developer guides for .NET Core and full framework, and it points to issues labelled help wanted. It adds a process note: leave a comment asking to be assigned the issue if you want to work on it. The repo also carries an AGENTS.md at the root and a .vsconfig listing required Visual Studio components, which tells you the supported development environment is Visual Studio 2026 rather than an editor-agnostic setup.

The licence is MIT, per the LICENSE file. MIT is permissive: it allows use, modification and redistribution provided the copyright notice and permission notice are included. This is not legal advice, and the practical question for most teams is narrower than the licence text. If you redistribute MSBuild or its task assemblies as part of your own product, check that the notice requirements are met in your packaging, and note that the repository also carries a THIRDPARTYNOTICES.txt covering third-party components. The README itself says only that MSBuild is licensed under the MIT license; it does not discuss redistribution scenarios.

Editorial conclusion

Adopt MSBuild if you build .NET projects and need the build to run outside Visual Studio, on a build server or in a script, or if you need to extend a build with your own tasks and loggers. Do not adopt it as a general-purpose build system for a repository that has no .NET or Visual Studio content, and do not expect the source-built bootstrap copy to cover every scenario: the README states it may not work for all scenarios, including C++ builds. Before committing, verify three things: which MSBuild you are actually invoking (the one shipped with Visual Studio, the one shipped with the .NET SDK, or a bootstrap build from artifacts\bin\bootstrap), whether your project's targets depend on workloads that only the IDE installs, and whether the MIT licence terms in LICENSE cover how you intend to redistribute the engine or its task assemblies.

Frequently asked questions

What is MSBuild used for?

It is a build platform: the README describes it as providing an XML schema for a project file that controls how the build platform processes and builds software. Visual Studio uses it, and invoking msbuild.exe on a project or solution file builds products in environments where Visual Studio is not installed.

Is MSBuild part of Visual Studio?

Visual Studio uses MSBuild, but the README states that MSBuild can run without Visual Studio. The engine is also available as its own repository and is documented separately on learn.microsoft.com.

How do I install MSBuild?

The README does not give an install command; it points to the MSBuild documentation on learn.microsoft.com for more information. What the README does document is building the engine from source, which on Windows requires Visual Studio 2026 with the .NET desktop development workload and .NET Framework 3.5.

How do I run MSBuild from the command line?

The README describes invoking msbuild.exe on your project or solution file as the way to orchestrate and build products. For a source build, run .\build.cmd from the repository root and the resulting engine appears at artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\MSBuild.exe.

Where is MSBuild in Visual Studio 2026?

The README does not give the installed path for MSBuild inside Visual Studio 2026. It documents the path for a source build, artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\MSBuild.exe, and notes that this bootstrap copy may not work for all scenarios, including C++ builds.

How do I run MSBuild without Visual Studio?

The README states that MSBuild can run without Visual Studio: by invoking msbuild.exe on your project or solution file, you can orchestrate and build products in environments where Visual Studio is not installed. On Unix, the README notes MSBuild can be run on systems that support .NET Core.

Official sources

  1. dotnet/msbuild on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/dotnet-msbuild.svg)](https://hysenlabs.com/projects/dotnet-msbuild)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/dotnet-msbuild.svg)](https://hysenlabs.com/projects/dotnet-msbuild)

Was this useful?