Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I output messages to the Visual Studio output window, from MSBuild?

I have tried adding <Message> elements to tasks in a Visual Studio project file, in order to debug the build process. However, the elements have no effect on the text that is written to the Visual Studio output window.

Is there a way to write messages to the Visual Studio output window, by adding markup to the project being built?

like image 297
mackenir Avatar asked Jan 15 '10 15:01

mackenir


2 Answers

This may help:

Under ToolsOptionsProjects and SolutionsBuild and Run, there’s the MSBuild project build output verbosity combo box. This controls how much info you want to see in the Output window.

like image 100
Nikola Smiljanić Avatar answered Sep 17 '22 14:09

Nikola Smiljanić


In your project properties → Build Events, you can add something like this in the Post-build event command line:

echo This is my message, no quotes required!

And then you'll be able to see it in the Output after a successful build (if configured to run on a successful build, which is my case).

like image 29
Andres Avatar answered Sep 21 '22 14:09

Andres