C# – MSBuild vs devenv for command line builds

cdevenvmsbuildvisual studio 2010

I was wondering: what is the difference between using msbuild and devenv when compiling solutions from the command line?

One obvious thing noticed was that msbuild does build dependent projects not contained within the solution, while devenv does not.

Are there any other? Are there some special flags one could pass to msbuild to make it match the devenv build exactly?

P.S. I'm using Visual Studio 2010 SP1

Best Answer

The main advantage of MSBuild is that you don't need to have Visual Studio installed.

One limitation of MSBuild is that it does not support building Visual Studio setup projects (.vdproj).

(You can work around this by defining an exec task which calls devenv, but then you still need Visual Studio.)