|This article does not cite any references or sources. (April 2013)|
MSBuild is a Microsoft build platform typically used in conjunction with Microsoft Visual Studio. The Visual Studio Application Lifecycle Management also depends on MSBuild to perform the actual team builds via the Team Foundation Server.
MSBuild version 2.0 is part of .NET Framework 2.0 and works together with Visual Studio 2005. Version 3.5 of MSBuild, which is bundled together with .NET 3.5 (and Visual Studio 2008), allows .NET projects to be built for either 2.0, 3.0 or 3.5 .NET version support (also known as"multi-targeting"). Version 4.0 of MSBuild is installed as part of .NET 4.0 (and Visual Studio 2012), and supports building projects targeting .NET Framework 2.0, 3.5, 4.0 and 4.5.
MSBuild is a build tool that helps automate the process of creating a software product, including compiling the source code, packaging, testing, deployment and creating documentations. With MSBuild, it is possible to build Visual Studio projects and solutions without the Visual Studio IDE installed. MSBuild is available at no cost with .NET Framework. MSBuild is a functional replacement for the nmake utility, the latter of which remains in use in projects that originated in older Visual Studio releases.
MSBuild acts on MSBuild project files which have a similar XML syntax to Apache Ant or NAnt. Even though the syntax is based upon well-defined XML schema, the fundamental structure and operation is comparable to the traditional Unix make utility: the user specifies what will be used (typically source code files) and what the result should be (typically an application), but the utility itself decides what to do and the order in which to do it.
||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. (April 2013)|
- 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 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.
- 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, 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 macros. Properties specify static values, whereas Items are usually used to define sets of files/folders on which to perform Tasks. Specifying files on Items is made easy by the support of wildcards.
- Kretzler, Brian (2011). MSBuild Trickery: 99 Ways to Bend the Build Engine to Your Will. K Cross Seven Ranch Company. p. 426. ISBN 978-0-615-50907-5.
- Hashimi, Sayed Ibrahim; Bartholomew, William (2009). Inside the Microsoft Build Engine: Using MSBuild and Team Foundation Build. Microsoft Press. p. 406. ISBN 978-0-7356-2628-7.
- Hashimi, Sayed Ibrahim (June 2006). "Inside MSBuild: Compiling Apps With Custom Tasks For The Microsoft Build Engine". MSDN Magazine (Microsoft). Retrieved 11 April 2013.
- Hashimi, Sayed Ibrahim (March 2007). "WiX Tricks: Automate Releases With MSBuild And Windows Installer XML". MSDN Magazine (Microsoft). Retrieved 11 April 2013.
- Hashimi, Sayed Ibrahim (February 2009). "MSBuild: Best Practices For Creating Reliable Builds, Part 1". MSDN Magazine (Microsoft). Retrieved 11 April 2013.
- Hashimi, Sayed Ibrahim (March 2009). "MSBuild: Best Practices For Creating Reliable Builds, Part 2". MSDN Magazine (Microsoft). Retrieved 11 April 2013.
- Reif, Andreas (10 June 2010). "Einführung in Microsofts Build-Management-Technik MSBuild" [Introduction to Microsoft's build management technology, MSBuild]. heise Developer (in German). Heinz Heise. Retrieved 11 April 2013.
- MSBuild Reference on Microsoft Developer Network
- Team Foundation Build overview on Microsoft Developer Network
- MSBuild Extension Pack on CodePlex
- MSBuild Launch Pad (mPad) on CodePlex
- MSBuild Shell Extension on CodePlex
- Open Source MSBuild Community Tasks Project on GitHub
- MSBuild Target Framework and Target Platform on Microsoft Developer Network