MSBuild echo task

msbuild

Is there a task in MSBuild that's synonymous with NAnt's <echo> task?

I don't want anything fancy, just a simple message output to stdout.

Best Answer

MsBuild has the Message task built in which will output a string to the console:

<Target ...>
  <Message Text="text to output" />
</Target>

By default, MSBuild logs at minimal verbosity which will prevent these messages from being seen. Either increase the verbosity, or set the Message's Importance parameter to high:

<Target ...>
  <Message Text="text to output ALWAYS" Importance="high" />
</Target>