51

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.

1 Answer 1

80

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>
1
  • 8
    Useful, but unfortunately the Message task only works inside a Target, you can't just sprinkle your build script with messages.
    – yoyo
    Commented Jul 22, 2014 at 19:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.