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

Is there a single MSBuild and TFSBuild variable that will point to where the binaries are?

Is there there a property that can be used in either a Visual Studio build or a TFS build that will always point to where the binaries are? Meaning that when I build in Visual Studio it will point to C:\MySolution\MyProject\bin\Release and in a TFS…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
7
votes
1 answer

Passing $(Configuration) as parameter to External Tool in VS2010

I am trying to pass the $(Configuration) macro as a parameter to an external tool (batch file), however, it apears to be empty. I tried by calling a simple test.bat that echo's the %1 parameter and pass the $(Configuration) macro as a param. Nothing…
Colin
  • 10,630
  • 28
  • 36
7
votes
2 answers

Using MSBuild to sign ClickOnce or assembly results in error MSB3321

I've set up my simple project in Visual Studio 2008 to use a ClickOnce installer. I've specified that the ClickOnce manifests should be signed by our comapny's PFX file. When I set this up in Visual Studio it asked for the password for the PFX file,…
Ray
  • 45,695
  • 27
  • 126
  • 169
7
votes
2 answers

MSBuild Package Location

When I run MSBuild with the /t:Package parameter I want to be able to specify where the folder that contains the *.cmd and *.zip files gets output. Specifying _PackageTempDir outputs the entire application without the deploy files (*.cmd and *.zip).…
Hungry Beast
  • 3,677
  • 7
  • 49
  • 75
7
votes
1 answer

When to use in project files?

Summary: Projects build in wrong order with visual studio and managed C++ and C# projects Description: I have a massive (100+ projects) solution file that is building a few projects in the wrong order. The solution file contains the following types…
C.J.
  • 15,637
  • 9
  • 61
  • 77
7
votes
2 answers

What is the impact of deleting a TFS build agent working directory?

My build agent working directories are starting to take too much space on the disk. I wonder if it is okay for me to delete some old folders, or if I should back them up. What is the impact of deleting a TFS build agent working directory? Are the…
alexandrekow
  • 1,927
  • 2
  • 22
  • 40
7
votes
1 answer

MSBuild: Copy files (if changed) and then do an action (only if files were updated)

In MSBuild I can use the Copy task to copy files from one location to another. I can also use the SkipUnchangedFiles property to specify that files should not be copied if they have not changed. Is there a standard pattern for predicating a…
Daniel Fortunov
  • 43,309
  • 26
  • 81
  • 106
7
votes
1 answer

Pass custom msbuild target from Solution to Project

I have a Solution with a large number of associated .csproj files. Each .csproj file has a .... The build fails when I try to compile the whole solution: > msbuild mysolution.sln /t:PublishQA` "c:\myproj.sln" (publishqa…
Byron Whitlock
  • 52,691
  • 28
  • 123
  • 168
7
votes
1 answer

MSBUILD: Adding 1 to a variable?

I have a text file with a numeric value in it (say 1). I open and read the file using:
Aref Karimi
  • 1,822
  • 4
  • 27
  • 46
7
votes
2 answers

How make MSBuild build custom target specified in csproj building sln?

I am facing an issue with MSBuild I can't overcome it by myself. As a result I rely on community's wisdom. The real situation I'm having troubles with I have a soluiton file containing several projects with dependencies to other projects in same…
nbulba
  • 645
  • 2
  • 7
  • 17
7
votes
3 answers

MSBuild and creating ZIP files

Here is my build script:
hs2d
  • 6,027
  • 24
  • 64
  • 103
7
votes
4 answers

MSBuild error MSB3086, with TeamCity

I am trying to build and deploy a .NET 4 project using MSBuild Web Deploy and TeamCity, I got this working fine (eventually) with an instance of TeamCity running on my local development machine, however when I tried to set up a fresh TeamCity…
Ben
  • 1,767
  • 16
  • 32
7
votes
2 answers

Why is ***NO_CI*** still causing a continuous intregration build?

I've recently discovered the "hidden feature" of TFS that allows you to prevent a CI build from kicking off if your comment contains ***NO_CI***. I have TFS running at home and this works little trick works like a charm. At work we are also using…
dkpatt
  • 580
  • 5
  • 12
7
votes
3 answers

How do I check if any file in an item list exist using msbuild?

I would like to run a task if any file in an item list is missing. How do I do that? My current script has a list of "source" files @(MyComFiles) that I translate another list of "destination" files @(MyInteropLibs), using the following…
Magnus Lindhe
  • 7,157
  • 5
  • 48
  • 60
7
votes
1 answer

Compiling x64 on 32bits version of windows (Teamcity)

Our Teamcity agent is running on a 32bits OS for now and this was not an issue up until now (we now have an x64 applications to build in there). I heard its possible to compile x64 applications on a 32bit OS but I've never did it. What would be the…
Benoittr
  • 4,091
  • 4
  • 27
  • 38
1 2 3
99
100