How can I perform a 'dry run' of MSBUILD f

2019-08-03 21:28发布

问题:

if I launch the RAD Studio command prompt and run

msbuild /t:Rebuild

in the project directory, msbuild will show the full command line to invoke dcc32, including all path settings. (see Is there a Delphi library which returns all effective source paths for a project?)

If I only want to capture this msbuild console output in a file, and do not need the compiler execution, is there a way to run msbuild only to display which actions it will perform? I have checked the msbuild options but there seems to be no 'dry run' switch.

One possible (but amateurish) solution could be to modify the PATH so that msbuild will not find the compiler.

回答1:

You can replace dcc32.exe with your own application which will log the command line and exit.



回答2:

I don't think this is possible. Also I don't think that you will have success by modifying the PATH variable. As far as I knwo the CSC task will not use that to locate where the csc.exe is located.