How can we create one visual studio project from the command line

I have a visual studio c test project (Helloworld project) generated from VS 2008 professional edition and containing a VC ++ project file.

May I know how I can build the same project from the command line (cmd) so that I don't need to use VS GUI to build the same one.

I'm quite confused that it might be necessary to create a make file, but I don't see any way to create ame in the visual studio mentioned in the release.

any suggestions or hints are greatly appreciated.


source to share

2 answers

You can control the solution or project build with vcbuild

or devenv

. An example of the latter:

devenv Solution.sln /build /project Project.vcproj /projectconfig "Debug|Win32"


(You can run vcbuild /?

and devenv /?

to find their commonly used options.)

Note that in Visual Studio 2010 and later projects, Visual C ++ uses MSBuild, so projects can be built on the command line using msbuild

just like any other MSBuild projects (C #, VB, etc.). The older VCBuild used in previous versions of Visual Studio is no longer supported.



This is usually done via nmake. VS60 allowed to export a makefile and use it with nmake (make make utility). (After we started writing our own makefile).

hopefully the newer version of Visual Studio will have similar or better options.



All Articles