# MSBuild

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/MSBuild
> Markdown URL: https://mediated.wiki/source/MSBuild.md
> Source: https://en.wikipedia.org/wiki/MSBuild
> Source revision: 1347750397
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Build automation software

"Microsoft build" redirects here. For the conference, see [BUILD (Microsoft)](/source/BUILD_(Microsoft)).

MSBuild Developers Microsoft, .NET Foundation Release 2003; 23 years ago (2003) Stable release v17.8.3 / 15 November 2023; 2 years ago (2023-11-15)[1] Written in C# Operating system Cross-platform Platform .NET Framework, .NET Type Build tool License MIT License Website docs.microsoft.com/visualstudio/msbuild/msbuild Repository github.com/dotnet/msbuild

**Microsoft Build Engine**, or **MSBuild**,[2][3] is a set of [free and open-source](/source/Free_and_open-source) [build tools](/source/Build_tool) for [managed code](/source/Managed_code) under the [Common Language Infrastructure](/source/Common_Language_Infrastructure) as well as native [C](/source/C_(programming_language)) and [C++](/source/C%2B%2B) code. It was first released in 2003 and was a part of [.NET Framework](/source/.NET_Framework). MSBuild is included with [Visual Studio](/source/Visual_Studio), but can also be run independently through MSBuild's [command-line interface](/source/Command-line_interface).[4]

## Overview

MSBuild is a [build tool](/source/Build_tool) that helps automate the process of creating a software product, including [compiling](/source/Compiler) the [source code](/source/Source_code), [packaging](/source/Software_package_(installation)), testing, [deployment](/source/Software_deployment) and creating documentations. With MSBuild, it is possible to build Visual Studio projects and solutions without the Visual Studio [IDE](/source/Integrated_development_environment) installed. MSBuild is [free and open-source](/source/Free_and_open-source).[5] MSBuild was previously bundled with [.NET Framework](/source/.NET_Framework); starting with [Visual Studio 2013](/source/Visual_Studio_2013), however, it is bundled with Visual Studio instead.[6] MSBuild is a functional replacement for the [nmake](/source/Nmake) utility, which remains in use in projects that originated in older Visual Studio releases.

MSBuild acts on MSBuild project files which have a similar [XML](/source/Extensible_Markup_Language) syntax to [Apache Ant](/source/Apache_Ant) or [NAnt](/source/NAnt). Even though the syntax is based upon well-defined [XML schema](/source/XML_schema), the fundamental structure and operation is comparable to the traditional Unix [make](/source/Make_(software)) utility: the user specifies what will be used (typically source code files) and what the result should be (typically a static library, DLL or an executable application), but the utility itself decides what to do and the order in which to carry out the build.

MSBuild can build a project against a supported .NET Framework version of choice. This feature is called "multitargeting". Any given build of a project, however, can only target one version of the framework at a time.[7]

## History

MSBuild was first created in 2003 targeting [.NET Framework 2.0](/source/.NET_Framework_2.0) for use in [Visual Studio 2005](/source/Visual_Studio_2005) (codenamed Whidbey)[8] and [Windows Vista](/source/Windows_Vista) (codenamed Longhorn).[9][10]

## Versions

Version .NET Framework Visual Studio Version Usual Install Locations (x86)[11] 2.0 2.0 2005 C:\Windows\Microsoft.NET\Framework\v2.0.50727 3.5 3.5 2008 C:\Windows\Microsoft.NET\Framework\v3.5 4.7.3062.0 4.0 2010 C:\Windows\Microsoft.NET\Framework\v4.0.30319 4.8.3761.0 4.5.2 2012 C:\Windows\Microsoft.NET\Framework\v4.0.30319 12.0[6] 4.5.2 2013 C:\Program Files (x86)\MSBuild\12.0\Bin 14.0 4.6 2015 C:\Program Files (x86)\MSBuild\14.0\Bin 15.0[12] 4.7 2017 C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin 16.0[13] 4.7.2 2019 C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin 17.0[14] 2022 C:\Program Files\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin 18.0 2026 C:\Program Files\Microsoft Visual Studio\2026\BuildTools\MSBuild\Current\Bin C:\Program Files\Microsoft Visual Studio\2026\Preview\MSBuild\Current\Bin C:\Program Files\Microsoft Visual Studio\2026\Professional\MSBuild\Current\Bin C:\Program Files\Microsoft Visual Studio\2026\Enterprise\MSBuild\Current\Bin C:\Program Files\Microsoft Visual Studio\2026\Community\MSBuild\Current\Bin

## Terminology

This section may be confusing or unclear to readers. In particular, it is unclear what this section is talking about and what is the nature of, say, a "Target" or "Task". Examples would help. Please help clarify the section. There might be a discussion about this on the talk page. (April 2013) (Learn how and when to remove this message)

**Target**
- A *Target* contains a set of tasks for MSBuild to execute. The focus of MSBuild is the result *Target* specified when invoking MSBuild with the project file. This is because a *Project* may contain several *Target* entries, each executed sequentially (and conditionally). Subsequent dependent Targets are executed before the requested Target. The execution flow of the current *Target* can be directed using the following attributes: Condition, BeforeTargets, AfterTargets, & DependsOnTargets. Each Target may be self-contained with the necessary Tasks to complete itself. A Target is typically an action executed on a file, set of files or directory.

**Task**
- A *Task* is a command which is executed in order to complete a Target. *Tasks* are used to group and execute any number of actions during the build process. They are typically implemented in a .NET assembly as a class which inherits from the Task class or implements the ITask interface. Many basic tasks are shipped as part of the .NET Framework,[15] and community developed tasks are freely available. Some examples of *Tasks* include copying files, creating directories, or parsing XML.

**Properties and Items**
- MSBuild provides *Properties* and *Items*, which are conceptually equivalent to [make's](/source/Make_(software)) [macros](/source/Macro_(computer_science)). Properties specify static values, whereas Items are usually used to define sets of files or folders on which to perform Tasks. Specifying files on Items is made easy by the support of wildcards.

## See also

- [Free and open-source software portal](https://en.wikipedia.org/wiki/Portal:Free_and_open-source_software)

- [List of build automation software](/source/List_of_build_automation_software)

## References

1. **[^](#cite_ref-1)** ["Latest release"](https://github.com/Microsoft/msbuild/releases/latest). Microsoft/msbuild. *[GitHub](/source/GitHub)*. [Microsoft](/source/Microsoft). Retrieved 2022-08-20.

1. **[^](#cite_ref-2)** ["microsoft/msbuild: The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio"](https://github.com/Microsoft/msbuild). *[GitHub](/source/GitHub)*. [Microsoft](/source/Microsoft). Retrieved 2019-07-23.

1. **[^](#cite_ref-3)** Hashimi, Sayed Ibrahim; Bartholomew, William (2009). *Inside the Microsoft Build Engine: Using MSBuild and Team Foundation Build*. Microsoft Press. p. 406. [ISBN](/source/ISBN_(identifier)) [978-0-7356-2628-7](https://en.wikipedia.org/wiki/Special:BookSources/978-0-7356-2628-7).

1. **[^](#cite_ref-Prime_4-0)** ["MSBuild"](https://docs.microsoft.com/visualstudio/msbuild/msbuild). MSBuild. *[Microsoft Docs](/source/Microsoft_Docs)*. Retrieved 2019-07-23.

1. **[^](#cite_ref-5)** Lander, Rich (18 March 2015). ["MSBuild Engine is now Open Source on GitHub"](https://devblogs.microsoft.com/dotnet/msbuild-engine-is-now-open-source-on-github/). .NET Blog. *MSDN Blogs*. [Microsoft](/source/Microsoft). Retrieved 2019-07-23.

1. ^ [***a***](#cite_ref-msb12_6-0) [***b***](#cite_ref-msb12_6-1) ["What's new in MSBuild 12.0"](https://docs.microsoft.com/visualstudio/msbuild/what-s-new-in-msbuild-12-0). MSBuild. *[Microsoft Docs](/source/Microsoft_Docs)*. Retrieved 2019-07-23.

1. **[^](#cite_ref-7)** ["MSBuild multitargeting overview"](https://docs.microsoft.com/visualstudio/msbuild/msbuild-multitargeting-overview). MSBuild. *[Microsoft Docs](/source/Microsoft_Docs)*. Retrieved 2019-07-23.

1. **[^](#cite_ref-8)** ["Building, Testing, and Deployment"](https://web.archive.org/web/20140826051347/http://msdn.microsoft.com/en-us/library/88fx1xy0(VS.80).aspx#rtmbuildtestdeploy). What's New in Visual Studio 2005. *MSDN*. Microsoft. Archived from [the original](http://msdn.microsoft.com/en-us/library/88fx1xy0(VS.80).aspx#rtmbuildtestdeploy) on 2014-08-26.

1. **[^](#cite_ref-Sneath2004_9-0)** Sneath, Tim (July 19, 2004). ["MSBuild: The New Build System for Visual Studio 2005 and Longhorn"](https://blogs.msdn.microsoft.com/tims/2004/07/19/msbuild-the-new-build-system-for-visual-studio-2005-and-longhorn/). Tim Sneath. *MSDN Blogs*. Retrieved 2018-04-22.

1. **[^](#cite_ref-England2010_10-0)** England, Chuck (February 25, 2010). ["Getting Started with MSBuild"](https://blogs.msdn.microsoft.com/visualstudio/2010/02/25/getting-started-with-msbuild/). The Visual Studio Blog. *MSDN Blogs*. Retrieved 2018-04-22.

1. **[^](#cite_ref-11)** ["Standard and custom Toolset configurations"](https://docs.microsoft.com/visualstudio/msbuild/standard-and-custom-toolset-configurations). MSBuild. *[Microsoft Docs](/source/Microsoft_Docs)*. Retrieved 2019-07-23.

1. **[^](#cite_ref-msb15_12-0)** ["What's new in MSBuild 15"](https://docs.microsoft.com/visualstudio/msbuild/what-s-new-in-msbuild-15-0). MSBuild. *[Microsoft Docs](/source/Microsoft_Docs)*. Retrieved 2019-07-23.

1. **[^](#cite_ref-msb16_13-0)** ["What's new in MSBuild 16.0"](https://docs.microsoft.com/visualstudio/msbuild/whats-new-msbuild-16-0). MSBuild. *[Microsoft Docs](/source/Microsoft_Docs)*. Retrieved 2019-07-23.

1. **[^](#cite_ref-msb17_14-0)** ["What's new in MSBuild 17"](https://docs.microsoft.com/visualstudio/msbuild/whats-new-msbuild-17-0). MSBuild. *[Microsoft Docs](/source/Microsoft_Docs)*. Retrieved 2026-04-08.

1. **[^](#cite_ref-15)** ["MSBuild task reference"](https://docs.microsoft.com/visualstudio/msbuild/msbuild-task-reference). MSBuild. *[Microsoft Docs](/source/Microsoft_Docs)*. Retrieved 2019-07-23.

## Further reading

- Kretzler, Brian (2011). *MSBuild Trickery: 99 Ways to Bend the Build Engine to Your Will*. K Cross Seven Ranch Company. p. 426. [ISBN](/source/ISBN_(identifier)) [978-0-615-50907-5](https://en.wikipedia.org/wiki/Special:BookSources/978-0-615-50907-5).

- Hashimi, Sayed Ibrahim (June 2006). ["Inside MSBuild: Compiling Apps With Custom Tasks For The Microsoft Build Engine"](https://web.archive.org/web/20150411004510/https://msdn.microsoft.com/en-us/magazine/cc163589.aspx). *MSDN Magazine*. Microsoft. Archived from [the original](http://msdn.microsoft.com/en-us/magazine/cc163589.aspx) on 11 April 2015. Retrieved 11 April 2013.

- Hashimi, Sayed Ibrahim (March 2007). ["WiX Tricks: Automate Releases With MSBuild And Windows Installer XML"](http://msdn.microsoft.com/en-us/magazine/cc163456.aspx). *MSDN Magazine*. Microsoft. Retrieved 11 April 2013.

- Hashimi, Sayed Ibrahim (February 2009). ["MSBuild: Best Practices For Creating Reliable Builds, Part 1"](http://msdn.microsoft.com/en-us/magazine/dd419659.aspx). *MSDN Magazine*. Microsoft. Retrieved 11 April 2013.

- Hashimi, Sayed Ibrahim (March 2009). ["MSBuild: Best Practices For Creating Reliable Builds, Part 2"](http://msdn.microsoft.com/en-us/magazine/dd483291.aspx). *MSDN Magazine*. Microsoft. Retrieved 11 April 2013.

- Reif, Andreas (10 June 2010). ["Einführung in Microsofts Build-Management-Technik MSBuild"](http://www.heise.de/developer/artikel/Einfuehrung-in-Microsofts-Build-Management-Technik-MSBuild-1017660.html) [Introduction to Microsoft's build management technology, MSBuild]. *heise Developer* (in German). [Heinz Heise](/source/Heinz_Heise). Retrieved 11 April 2013.

- Jones, Mike; Warren, Genevieve; Blome, Mike; Robertson, Colin; Hogenson, Gordon; Cai, Saisang (4 November 2016). ["MSBuild target framework and target platform"](https://docs.microsoft.com/visualstudio/msbuild/msbuild-target-framework-and-target-platform). MSBuild. *[Microsoft Docs](/source/Microsoft_Docs)*. Retrieved 2018-02-19.

## External links

- [Official website](https://docs.microsoft.com/visualstudio/msbuild/msbuild)

v t e Microsoft development tools Development environments Visual Studio Code Express Team System Profiler Tools for Applications Tools for Office Others Blend Expression Web FxCop GW-BASIC MACRO-80 Macro Assembler MSBuild Pascal QuickBASIC QBasic QuickC Robotics Developer Studio Roslyn SharePoint Designer FrontPage Small Basic WebMatrix Windows App SDK Windows App Studio Windows SDK CLR Profiler ILAsm Native Image Generator WinDiff XAMLPad Languages Dynamics AX BASIC Visual Basic legacy VB.NET VBA VBScript Bosque Visual C++ C++/CX C++/CLI Managed C++ C++/WinRT C# C/AL Dafny Dexterity F# F* Visual FoxPro Java J++ J# JavaScript TypeScript JScript IronPython IronRuby Lean P Power Fx PowerShell Project Verona Q# Small Basic VPL XAML APIs and frameworks Native Windows API Silverlight XNA DirectX Managed DirectX UWP Xbox Development Kit Windows Installer WinUI .NET ASP.NET Core AJAX Dynamic Data MVC Razor Web Forms ADO.NET Entity Framework MAUI CardSpace Communication Foundation Identity Foundation LINQ Presentation Foundation Workflow Foundation Device drivers WDK WDF KMDF UMDF Windows HLK WDM Database SQL Server Express Compact Management Studio MSDE SQL services Analysis Reporting Integration Notification Other Visual FoxPro Microsoft Access Access Database Engine Extensible Storage Engine Source control Visual SourceSafe Team Foundation Version Control Testing and debugging CodeView OneFuzz Playwright Script Debugger WinDbg xUnit.net Delivery Active Setup ClickOnce npm NuGet vcpkg Web Platform Installer Windows Installer WiX Windows Package Manager Microsoft Store Category

v t e Microsoft free and open-source software (FOSS) Overview Microsoft and open source Shared Source Initiative Software Applications 3D Movie Maker Atom Conference XP Family.Show File Manager Open Live Writer Microsoft Edit Microsoft PowerToys Terminal Windows Calculator Windows Console Windows Package Manager WorldWide Telescope XML Notepad Video games Allegiance Zork Programming languages Bosque C# Dafny F# F* GW-BASIC IronPython IronRuby Lean P Power Fx PowerShell Project Verona Q# Small Basic Online TypeScript Visual Basic Frameworks, development tools .NET .NET Framework .NET Gadgeteer .NET MAUI .NET Micro Framework AirSim ASP.NET ASP.NET AJAX ASP.NET Core ASP.NET MVC ASP.NET Razor ASP.NET Web Forms Avalonia Babylon.js BitFunnel Blazor C++/WinRT CCF ChakraCore CLR Profiler Dapr DeepSpeed DiskSpd Dryad Dynamic Language Runtime eBPF on Windows Electron Entity Framework Fluent Design System Fluid Framework Infer.NET LightGBM Managed Extensibility Framework Microsoft Automatic Graph Layout Microsoft C++ Standard Library Microsoft Cognitive Toolkit Microsoft Design Language Microsoft Detours Microsoft Enterprise Library Microsoft SEAL mimalloc Mixed Reality Toolkit ML.NET mod_mono Mono MonoDevelop MSBuild MsQuic Neural Network Intelligence npm NuGet OneFuzz Open Management Infrastructure Open Neural Network Exchange Open Service Mesh Open XML SDK Orleans Playwright ProcDump ProcMon Python Tools for Visual Studio R Tools for Visual Studio RecursiveExtractor Roslyn Sandcastle SignalR StyleCop SVNBridge T2 Temporal Prover Text Template Transformation Toolkit TLA+ Toolbox U-Prove vcpkg Virtual File System for Git Voldemort VoTT Vowpal Wabbit Windows App SDK Windows Communication Foundation Windows Driver Frameworks KMDF UMDF Windows Forms Windows Presentation Foundation Windows Template Library Windows UI Library WinJS WinObjC WiX XDP for Windows XSP xUnit.net Z3 Theorem Prover Operating systems MS-DOS (v1.25, v2.0 & v4.0) Barrelfish SONiC Azure Linux Other ChronoZoom Extensible Storage Engine FlexWiki FourQ Gollum Project Mu ReactiveX SILK TLAPS TPM 2.0 Reference Implementation Windows Subsystem for Linux Licenses Microsoft Public License Microsoft Reciprocal License Forges CodePlex GitHub Related .NET Foundation F# Software Foundation Microsoft Open Specification Promise Open Letter to Hobbyists Open Source Security Foundation Outercurve Foundation Category

---
Adapted from the Wikipedia article [MSBuild](https://en.wikipedia.org/wiki/MSBuild) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/MSBuild?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
