Answers from stackoverflow.com:
With VS2008 you can do this:devenv solution.sln /build configuration
answered Aug 29 '08 at 6:38
This way always seems the easiest. – Aardvark Sep 25 '08 at 22:53
\Windows\Microsoft.NET\Framework\[YOUR .NET VERSION]\msbuild.exe
Lots of command line parameters, but the simplest is just:msbuild.exe yoursln.sln
answered Aug 23 '08 at 20:46
nant and msbuild are the most popular tools to automate your build in .net, and you can can find a discussion on there the pros/cons of each in this question "best .net build tool"
edited Aug 23 '08 at 21:02
answered Aug 23 '08 at 20:52
Look into build tool NAnt (http://nant.sourceforge.net/) or MSBuild (http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx). I believe MSBuild is the build tool for VS2005+, I am however a fan of NAnt...
answered Aug 23 '08 at 20:43
As of VS2005, all of the project files (at least for .NET based projects) are actual MSBuild files, so you can call MSBuild on the command line and pass it the project file.
Bottom line is that you need to use a "build scripting language" like NAnt or MSBuild (there are others, but these are the mainstream ones right now) if you want to have any real control over your build process.
answered Aug 28 '08 at 17:09
Simplest way: navigate to the directory containing the solution or project file, and run msbuild (assuming you have Visual Studio 2005 or newer).
More flexible ways:
read up on the MSBuild reference. There's tons of customization, especially once you've installed the community tasks.
use NAnt. It has existed for longer than MSBuild and has more community support, but requires you to start a project file from scratch, rather than extending the existing, VS-created one.
answered Aug 23 '08 at 20:44
I had to do this for a C++ project in Visual Studio 2003 so I don't know how relevant this is to later version of visual studio:
In the directory where your executable is created there will be a BuildLog.htm file. Open that file in your browser and then for each section such as:Creating temporary file "c:\some\path\RSP00003C.rsp" with contents[/D "WIN32" /D "_WINDOWS" /D "STRICT" /D "NDEBUG" ..... (lots of other switches).\Project.cpp.\Another.cpp.\AndAnother.cpp".\And Yet Another.cpp"]Creating command line "cl.exe @c:\some\path\RSP00003C.rsp /nologo"
create a .rsp file with the content between the square brackets (but not including the square brackets) and call it whatever you like. I seem to remember having problems with absolute paths so you may have to make sure all the paths are relative.
Then in your build script add the command line from the BuildLog.htm file but with your .rsp filename:cl.exe @autobuild01.rsp /nologo