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
1 answer

Run an MSBuild target only if project is actually built

I have an MSBuild file that builds */.sln files (builds all .sln files that exist). The build uses the Build target, so if no changes were made to input files, no project should be built again. I would like to execute some custom target only if a…
lysergic-acid
  • 19,570
  • 21
  • 109
  • 218
8
votes
2 answers

How to configure the publish profiles to use NTLM authentication

In Visual Studio 2012, using publish profiles along with web deploy simplifies the deployments quite a bit. However it still is missing few things or may be I don't know how to use it yet. I prefer to use the NTLM authentication without storing the…
amit_g
  • 30,880
  • 8
  • 61
  • 118
8
votes
1 answer

msbuild transform one config few times

I have next config in my Web.config file
Sanja Melnichuk
  • 3,465
  • 3
  • 25
  • 46
8
votes
3 answers

MSBuild: Deploying files that are not included in the project

I have a Pre-build event on a web project that minifies and concatenates javascript files using node. This creates a folder called BuiltScripts in the scripts folder that is a duplicate of the scripts folder except the files are minified. When I am…
Aran Mulholland
  • 23,555
  • 29
  • 141
  • 228
8
votes
1 answer

creating a targeted OBJ folder for a project in Visual Studio

Is it possible to create a targeted OBJ file path much like you can do for a BIN folder? You can set the output path in the Project's properties. Example paths would be: Bin\Debug\Windows Phone 7\ Bin\Debug\NETMF\ Bin\Debug....\ A use case here is…
Clint Rutkas
  • 280
  • 2
  • 8
8
votes
4 answers

Msbuild fails with error msb4064 and msb4063

After installing Visual Studio 2012 with .NET 4.5 I started to get the following errors while building using msbuild: error MSB4064: The "SdkToolsPath" parameter is not supported by the "GenerateResource" task. Verify the parameter exists on the…
vladimir.karukes
  • 81
  • 1
  • 1
  • 5
8
votes
1 answer

Get the assembly project file name from Output TaskParameter

I am using msbuild.exe to automate my build from the command line. I do the following steps. Compile projects into a folder each outside the project directory zip every compiled project here are my targets first one to compile
Jürgen Steinblock
  • 30,746
  • 24
  • 119
  • 189
8
votes
4 answers

Determine if MSBuild CoreCompile will run and call custom target

This seems like an obvious thing to want to do but I have pulled most of my hair out trying to find any examples on the web or do it myself. I have a c# solution with 19 projects and a Jenkins build server running a build script to drive MSBuild.…
Akuma
  • 551
  • 1
  • 5
  • 21
8
votes
2 answers

Using AssemblyInfo to automatically update multiple AssemblyInfo.cs files

I've got several AssemblyInfo.cs files as part of many projects in a single solution that I'm building automatically as part of TeamCity. To make the msbuild script more maintainable I'd like to be able to use the AssemblyInfo community task in…
Kieran Benton
  • 8,739
  • 12
  • 53
  • 77
8
votes
2 answers

specflow fails when trying to generate test execution report

I've got a project that's using SpecFlow, NUnit and Coypu to do acceptance tests on a web application. I've got the project building OK via Jenkins on a build server. Jenkins calls a psake script which runs msbuild on the specs project, then the…
ngm
  • 7,277
  • 1
  • 53
  • 62
8
votes
1 answer

MSBuild exec task, exit code empty

I have the following exec task, performing checkin of assemblyinfo.cs files. I'm trying to return the exit code, but for some reason it is always empty.
jaspernygaard
  • 3,098
  • 5
  • 35
  • 52
8
votes
6 answers

Why is msbuild and link.exe "hanging" during a build?

We have a few C++ solutions and we run some build scripts using batch files that call msbuild.exe for each of the configurations in the solutions. This had been working fine on 3 developer machines and one build machine, but then one of the projects…
Tim
  • 20,184
  • 24
  • 117
  • 214
8
votes
1 answer

Using MSBuild, how do I set a property to the contents of a file?

I have a file that I set using PowerShell that contains the version number of my build. I need to get this within MSBuild so I can act on it within my build script. It seems simple enough; I just want to take the contents of the file and set a…
Kirk Liemohn
  • 7,733
  • 9
  • 46
  • 57
8
votes
2 answers

AxImp .NET4.0 runtime mismatch

I have a problem with the compilation of a C#/WPF application using MSBuild. The problem is the following. I have created a Visual Studio 2010 project with a default WPF application. I created an "old fashioned" Windows Forms usercontrol which I…
Ralph Schiedon
  • 151
  • 1
  • 1
  • 5
8
votes
1 answer

Error6 while trying to use sublime text to msbuild

I'm trying to use msbuild with my sublime project. I created the build file suggested here and the following is my project file { "folders": [ { "path": "/W/MyOrg/MyApp", …
George Mauer
  • 117,483
  • 131
  • 382
  • 612