Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get MSBuild to output a file to the log?

Tags:

msbuild

I've got a program that outputs to a file. I'm running it from an MSBuild project. I'd like this output to be written to StdOut, so that it can be picked up by our build agent (TeamCity).

How do I get MSBuild to dump the content of a file to the output?

like image 759
Roger Lipscombe Avatar asked May 05 '10 12:05

Roger Lipscombe


People also ask

How do I view the build log in Visual Studio?

On the menu bar, choose Build > Build Solution. In the Output window, click somewhere in the text. Press Ctrl+S. Visual Studio prompts you for a location to save the build output.

How do I run an MSBuild file?

To run MSBuild at a command prompt, pass a project file to MSBuild.exe, together with the appropriate command-line options. Command-line options let you set properties, execute specific targets, and set other options that control the build process.

What is a build log?

A build log is an enhanced console output of a build. It is represented by a structured list of the events which took place during the build. Generally, it includes entries on TeamCity-performed actions and the output of the processes launched during the build.


1 Answers

The dos command type could to that.

<Target Name="ExecProgramAndOutputToStdOut">
  <Exec Command="YourProgram.exe"/>

  <Exec Command="type output_file"/>
</Target>
like image 104
Julien Hoarau Avatar answered Oct 03 '22 23:10

Julien Hoarau