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

Specify Machine Name in Web.Config Transform

I am using Web.config transforms to successfully create debug and release versions of the my web.config - this is working correctly. I am interested to know whether there is a 'machine name' property to specify the current machine name which I can…
Nick Heppleston
  • 1,973
  • 11
  • 18
8
votes
0 answers

Compile Razor views into a single assembly

What is the least invasive way of compiling .cshtml views into a single assembly? By "least invasive" I mean something that doesn't require twiddling with Custom Tools, setting esoteric values in .cshtml files and things of that nature? I tried…
Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288
8
votes
2 answers

Seeing project dependancies from MSBuild

Is there a mode, some switch or a programmatic way that I can ask MSBuild to display or output it's calculated dependencies for a given build file? Some background - I have a large project that requires splitting up to speed up the build time and…
Ray Hayes
  • 14,896
  • 8
  • 53
  • 78
8
votes
3 answers

MSBuild: how to control the parsing of a semicolon delimited property

When a single property contains semicolons, MSBuild automatically parse the property into a list of properties when used within an itemgroup. Here's a snippet from my project: workstation id=.;packet…
KMoraz
  • 14,004
  • 3
  • 49
  • 82
8
votes
1 answer

How does Visual Studio decide when and how to rebuild IntelliSense?

I'm trying to write a code generation tool. For this tool it's important that the generated code is available prior to building (i.e., for IntelliSense). I know Visual Studio will at least partially evaluate the project build plan automatically to…
Jacob
  • 1,699
  • 10
  • 11
8
votes
2 answers

Storing Windows SDKs in source control?

The question is at the end - let me start by posing the context: One of the problem we are facing at work when using Visual Studio is to make sure that everybody on the team is using the same version of the SDKs. A typical problem would be to have…
8
votes
2 answers

Build C++/C# created with Visual Studio 2012 without VS 2012 being installed?

If I have a Visual Studio Solution file of VS2012 with few C++ native projects and a few C# projects, can I build this solution without installing Visual Studio 2012 itself? This would ease (among other things) the maintenance on our Build-Server…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
8
votes
2 answers

$(MSBuildProjectDirectory) and "program files (x86)" folder

I'm using the property MSBuildProjectDirectory with MSBuild. The project is located in: C:\Program Files (x86)\Jenkins\workspace\MyProject During build MSBuildProjectDirectory is instead evaluated as: C:\Program Files…
Be.St.
  • 4,101
  • 3
  • 25
  • 35
8
votes
1 answer

Create MSBuild custom task to modify C# code *before* compile

I want to create a custom MSBuild task that changes my .cs files before they are compiled by csc.exe (but, of course, that doesn't modify them in place - I don't want actual source files touched). I am aware of PostSharp and other AOP frameworks…
ZeroBugBounce
  • 3,652
  • 3
  • 31
  • 40
8
votes
1 answer

Running command after publishing files

I am trying to run a command after publishing. But as you see below, it copies the published output after calling this…
Rick Rat
  • 1,732
  • 1
  • 16
  • 32
8
votes
1 answer

How can I speed up Visual Studio builds to match MSBuild parallel performance?

I encounter a noticable difference in the speed when building the same solution one time with Devenv and the other time with msbuild /m. As an information I have set the parameter "number of parallel build processes" in Visual studio to 4. Is there…
schoetbi
  • 12,009
  • 10
  • 54
  • 72
8
votes
1 answer

Failed to successfully launch or connect to a child MSBuild.exe process

In VS2012, when building I frequently will get the following error: Error 5 The build stopped unexpectedly because of an internal failure. Microsoft.Build.Exceptions.BuildAbortedException: Build was canceled. Failed to successfully launch or…
Rob Taylor
  • 197
  • 2
  • 7
8
votes
1 answer

Error CS0433 in large precompiled Asp.net Website Project

Background I've taken over a very large asp.net website project. The old deploy process was to copy .cs, .aspx, and .ascx files to IIS and have it build on the fly. I want to precompile it and use TeamCity to automatically deploy it. I've done this…
Paul Lemke
  • 5,494
  • 3
  • 47
  • 66
8
votes
3 answers

Changeset Number into Version Info with hosted TFS

We're using Team Foundation Service instead of a local TFS. Our solution was created on Visual Studio 2012. My problem is now that we want all assemblies to have the same version number (this part is already solved by using a CommonAssemblyInfo.cs…
AlexK
  • 493
  • 8
  • 20
8
votes
3 answers

How to set publishName/AssemblyName in msbuild command line parameters?

There are two names for the application that you are publishing, the productName and the publishName (publishName/AssemblyName I think they are the same). Both of which you can specify in your .csproj file. I want to set both of these without…
jgerstle
  • 1,674
  • 5
  • 25
  • 35