blog community
How does MSBuild build a solution?

MSBuild only builds Xml files that follow the MSBuild standards.

However, there is a special case for solutions, because you can just build solutions using MSBuild, although this is not an MSBuild format.

MSBuild supports this by first generating an in-memory MSBuild file (called a traversal project) that will build all projects included in the solution.

Sometimes, it is useful to know how this internal traversal project looks. There is a way to make MSBuild save this file. This is done by setting an enviroment variable:

set MSBuildEmitSolution=1

When you run MSBuild this will create an additional project file in the current directory with this traversal project, so you can see how things are done. For instance, when you are using web projects, you will see the magic that calls the ASP.NET compiler :-)


Posted 22-05-2006 12:45 by Raimondb
Filed under: , ,

Comments

TrackBack wrote VSTS Links - 05/25/2006
on 25-05-2006 15:29
Raimond Brookman asks the question: How does MSBuild build a solution?

Clark Sell asks the question:...
J Leonard wrote re: How does MSBuild build a solution?
on 17-01-2007 22:45

At the command line, I typed

set MSBuildEmitSolution=1 <enter>

Then I typed

MSBuild <enter>

There was no new file.

Since the author did not mention what the name of this new file would be, I'm unable to even search my hard drive to find it.

This article was not useful as it seem to do nothing.

Raimondb wrote re: How does MSBuild build a solution?
on 18-01-2007 13:13

I assume that you ran MSBuild on an actual solution file and not ran it in some random directory where no solution file was available?

In the second case; nothing will happen, as the flag just outputs the msbuild translation of the .sln file...

Team Foundation Sidekicks wrote Building Visual Studio solutions with MSBuild Sidekick
on 13-02-2008 9:05

What do you do in Visual Studio when you need to develop several related modules at the same time? Probably

David Engh wrote re: How does MSBuild build a solution?
on 23-05-2009 0:53

Is this still active with VS2008 SP1 / .NET Framework 3.5 SP1?  tried it and don't see anything looking like a .proj file with a timestamp even near my execution time.  

I'm trying to run down an apparent behavior change with SP1.  Previously, every .csproj listed in the .sln built; now it appears only those with detectable dependencies in the start up project build.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Enter code (required)
Powered by Community Server (Commercial Edition), by Telligent Systems