## Friday, July 18, 2008

### How to compile from the command line with Visual Studio

I often forget how to compile a project from the command line. Here's my little reminder:

• First run C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat
• Then call something of the form:  devenv c:\Foo\MySolution.sln /build "Release"

Note that this works for Visual Studio 2005. Small changes may be needed in other versions. Also, I don't think 'devenv' comes with the Express edition - try using 'VCExpress.exe' instead.

#### 1 comment:

Anonymous said...

Hey man you are second way. Try to start Visual Studio command prommt. Then goto solution solder. Finally type this code and press enter: msbuild projectName.sln or
msbuild projectName.vcproj