Create one project inside the solution from the command line

I am working on a large solution in C ++ in Visual Studio 2005. I want to write all the output from the assembly of one project in this solution. The output window in VS seems to be faulty. I suspect there is too much output for this. I can not copy the output, and I can not even save it to disk.

My idea is to build a project on the command line and just redirect the output to a file. I am not sure which team I must execute in order to build a project in the context of a solution. I tried just vcbuild the project, but I think that it lacks the data inherited from the solution.

Any ideas?

+4
source share
3 answers

Use DevEnv from the command line:

DevEnv /Build Debug /Project ProjectName %SOLUTION_FILE% 

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

The complete solution can be rebuilt with:

 DevEnv /Rebuild Debug %SOLUTION_FILE% 

Example; for a project (installer) named MSQuantSetup:

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

Or directly without an environment variable:

 DevEnv /Build Debug /Project MSQuantSetup D:\dproj\MSQall\MSQuant\MSQuant.sln 
+7
source

Take a look at this page , I think this is what you are looking for. Do not forget the / Project option if you want to create only one project.

+1
source

C # version with MSBuild (enter the code below into the .bat file)

 set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319 set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v2.0.50727 call %msBuildDir%\msbuild ".\SomeFolder\MyCSharpProject.csproj" /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Manual_MSBuild_ReleaseVersion_One_Project_CSharp_LOG.log set msBuildDir= 

Or for C ++:

 set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v2.0.50727 set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319 call %msBuildDir%\msbuild ".\Project1\Project1\Project1.vcxproj" /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Manual_MSBuild_ReleaseVersion_One_Project_C_Plus_Plus_LOG.log set msBuildDir= 

You will need to select a framework (2.0 or 4.0 (or another), where I have

 set msBuildDir=%WINDIR%\Microsoft.NET\Framework\vA.BCDEF 

Just comment out or delete the version of the framework you don't want.

I had a solution with five (sub) projects. I built the "lowest" project. And he just built this (single) assembly.

Keep in mind that if the project you choose has dependencies, it will also build them. AKA, if you choose the "largest" assembly, it will build everything it needs.

0
source

All Articles