Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build one project inside a solution from the command line

I am working on a large C++ solution in Visual Studio 2005. I want to log all of the output from the build of one project within that solution. The output window in VS seems to be malfunctioning. I suspect there is too much output for it to handle. I can't copy the output and I can't even save it to disk.

My idea is to build the project on the command line and just redirect the output to a file. I'm not sure what command I have to execute in order to build a project in the context of a solution. I tried to just vcbuild the project, but I think it's missing data inherited from the solution.

Any ideas?

like image 823
Dave Avatar asked Aug 28 '09 07:08

Dave


2 Answers

Use DevEnv from the command line:

DevEnv /Build Debug /Project ProjectName  %SOLUTION_FILE%

where %SOLUTION_FILE% is an environment variable holding the full path to the solution file and ProjectName is the name of the project. The output will go to standard output.

The entire solution can be rebuild with:

DevEnv /Rebuild Debug %SOLUTION_FILE%

Example; for an (installer) project named MSQuantSetup:

set SOLUTION_FILE=D:\dproj\MSQall\MSQuant\MSQuant.sln
DevEnv /Build Debug /Project MSQuantSetup  %SOLUTION_FILE%

Or directly without the environment variable:

DevEnv /Build Debug /Project MSQuantSetup  D:\dproj\MSQall\MSQuant\MSQuant.sln
like image 139
Peter Mortensen Avatar answered Nov 15 '22 18:11

Peter Mortensen


Take a look at this page, I think this is what you are looking for. Don't forget the /Project parameter if you want to build only one project.

like image 43
erelender Avatar answered Nov 15 '22 18:11

erelender