Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSbuild 4 with /pp (/preprocess) does not write preprocessed file

I want to create a pre processed file with msbuild for diagnostic reasons. The documentation states, that I just need to call msbuild with the /pp:Filename switch. So I did:

msbuild project.sln /t:Build /p:Configuration=Release /pp:out.txt

It also creates an 'out.txt' file, so the argument obviously has SOME impact, but the file is empty (size 0, no content). So what could be possible reasons the preprocessed project file isn't written correctly? The project file builds fine though.

like image 231
Sebastian P.R. Gingter Avatar asked Jan 12 '12 12:01

Sebastian P.R. Gingter


1 Answers

BTW MSBuild is able to generate a projectfile from any solution. Just set the following environment variable

Set MSBuildEmitSolution=1

and execute

msbuild.exe MySolution.sln. 

It will generate a MySolution.sln.metaproj which is able to carry the preprocess parameter

like image 121
Thorsten Hans Avatar answered Nov 18 '22 11:11

Thorsten Hans