MSbuild 4 with / pp (/ preprocess) does not write pre-processed file

I want to create a preprocessed file with msbuild for diagnostic reasons. The documentation states that I just need to call msbuild with / pp: file name. 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 a DIRECT effect, but the file is empty (size 0, no content). So, what could be the reasons why the preprocessed project file is not written correctly? The project file builds fine, though.

+5
source share
2 answers

BTW MSBuild can generate a project file from any solution. Just set the following environment variable

Set MSBuildEmitSolution=1

and execute

msbuild.exe MySolution.sln. 

MySolution.sln.metaproj,

+7

, , preprocess MSBuild.

+3

All Articles