views:

164

answers:

2

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?

+1  A: 

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.

erelender
+4  A: 

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
Peter Mortensen