How can I direct MSBUILD output to a file?

For statistic reasons I would like to direct the output of MSBUILD to a text file.
On command line level, this can be done using output redirection:

msbuild example.dproj > mymsbuild.log

Is there a way to do this in a MSBUILD stage in Continua CI? I tried with “Extra parameters” in the MSBUILD Action Options page, but this causes an error (“error MSB1008”)

Regards
Michael

Hi Michael,

You can use the -fileLogger parameter in the Extra Parameters field to write the MSBuild output to a file.

e.g.

-fileLogger -fileLoggerParameters:logfile=$Workspace$\Output\MSBuildOutput.log;verbosity=diagnostic

See Obtain build logs with MSBuild (microsoft.com)

1 Like