Questions tagged [msbuild]

Microsoft Build Engine, also known as MSBuild, is a build platform for managed code and was part of .NET Framework.

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. MSBuild was previously bundled with .NET Framework; starting with Visual Studio 2013, however, it is bundled with Visual Studio instead. 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.

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.

FAQ

Resources

14915 questions
8
votes
2 answers

How do I change the build directory that MSBuild uses under Team Foundation Build?

I'm getting the following error when trying to build my app using Team Foundation Build: C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1682,9): error MSB3554: Cannot write to the output file…
Luke
  • 18,585
  • 24
  • 87
  • 110
8
votes
1 answer

How do I get an msbuild task to do config transforms on a collection of files?

I am trying to transform all of the web.config files in a project I have, here's a my tree structure: Transform.bat Transforms ConfigTransform.proj Web.Transform.config Website web.config Views web.config There's more web.config files, but…
sebastiaan
  • 5,870
  • 5
  • 38
  • 68
8
votes
1 answer

Mulitargeting C# project files with Mono and MonoDevelop

I have a collection of csproj files that all refer to the same set of source files, but have slightly different target data making it so I need to keep the project files separate. E.g. there are WinPhone, XBox, Desktop, MonoTouch variants of the…
Joe Castro
  • 2,181
  • 18
  • 24
8
votes
2 answers

Do I really need cmake for build automation?

I'm currently investigating cmake to allow automatic building on the Win32 platform. For all runtimes and libraries I'd like to build, Visual Studio (2008/2010) projects do allready exist. I've come across cmake, but I'm unsure if I really need it.…
PMiller
  • 241
  • 1
  • 5
  • 15
7
votes
4 answers

teamcity building project Failed to start MSBuild.exe. Illegal characters in path

I am trying to build a project within teamcity. It will do the checkout of TFS and the files are locally on the build server. If I manually run the build command on the server it works: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe…
Jon
  • 15,110
  • 28
  • 92
  • 132
7
votes
1 answer

How to setup build/deployment for .net project on Jenkins

We currently uses Jenkins for all our (Java) build/deployment from a Linux box. Now we are building a .net client and would like to have a similar automated build/deployment process. I have some research and found the MSBuild plugin for Jenkins. …
ltfishie
  • 2,917
  • 6
  • 41
  • 68
7
votes
3 answers

TFSBuild.proj and Importing External Targets

We want to store our overridden build targets in an external file and include that targets file in the TFSBuild.proj. We have a core set steps that happens and would like to get those additional steps by simply adding the import line to the…
Mark
  • 9,966
  • 7
  • 37
  • 39
7
votes
4 answers

How to build dependent project first with msbuild

I have just started looking into msbuild, because I want to make my own build scripts. For now I am able to create build scripts that compiles only one project, but how do I handle dependencies? For example what if I have two projects that gets…
mslot
  • 4,959
  • 9
  • 44
  • 76
7
votes
2 answers

Simple Powershell Msbuild with parameter fails

I am trying to pass a simple variable passing, No parameter msbuild MySolution.sln /p:Configuration=Debug /p:Platform="Any CPU" Try 1 $buildOptions = '/p:Configuration=Debug /p:Platform="Any CPU"' msbuild MySolution.sln + $buildOptions -> cause…
Nap
  • 8,096
  • 13
  • 74
  • 117
7
votes
1 answer

Is it possible to pass a workingdirectory with a space to MSBuild EXEC command task?

For the Command parameter, one can escape the path via ", however, this doesn't work if there is a space in the WorkingDirectory parameter. Does anyone have a solution? Perhaps changing my environment HOMEDRIVE\ HOMEPATH setting before calling…
nicodemus13
  • 2,258
  • 2
  • 19
  • 31
7
votes
1 answer

Can't msdeploy web package to temporary folder?

We've got an Asp.Net web application we're trying to get pseudo-deployed to a folder, and I'm starting to think Microsoft are crazy -- why is it so hard to get a WAP to do a "Local FileSystem" deploy as part of MSBuild? I can build with…
Jaykul
  • 15,370
  • 8
  • 61
  • 70
7
votes
1 answer

Create a clickonce webdeploy package

Is it possible to build a web deploy package containing a clickonce application that can be deployed to a web server using the standard webdeploy tool? Here would be the ideal process: MSBuild "YourFullyQualifiedProjectName.csproj/vbproj"…
Daniel Bradley
  • 1,120
  • 1
  • 12
  • 22
7
votes
4 answers

Msbuild copy to several locations based on list of destination parameter?

I got a directory I want to copy to a number of locations. Say I have home.aspx I want to copy it to abc/home.aspx def/home.aspx ghi/home.aspx so two questions for me: How do I define the list abc, def, ghi? How do I execute my Copy task with…
Boris Callens
  • 90,659
  • 85
  • 207
  • 305
7
votes
1 answer

MSBuild.exe output encoding

I use MSBuild.exe for building solution on machine with russian language. But in TeamCity build log all russian chars in wrong encoding. How to setup MSBuild.exe for properly output (UTF-8 for example)?
Dmitriy Kudinov
  • 1,051
  • 5
  • 23
  • 31
7
votes
1 answer

error MSB6006: "cmd.exe" exited with code

I am building driver for my USB device. While building using msvisual studio10 I am getting following two errors: C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with…
Jay
  • 81
  • 1
  • 6
1 2 3
99
100