Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild echo task?

Tags:

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.

like image 804
vicsz Avatar asked Oct 15 '10 17:10

vicsz


People also ask

Will MSBuild compile a file without any target?

If MSBuild determines that any output files are out of date with respect to the corresponding input file or files, then MSBuild executes the target. Otherwise, MSBuild skips the target. After the target is executed or skipped, any other target that lists it in an AfterTargets attribute is run.

Which tasks in MSBuild can be used by developers in code with MSBuild?

MSBuild includes common tasks that you can modify to suit your requirements. Examples are Copy, which copies files, MakeDir, which creates directories, and Csc, which compiles Visual C# source code files.

What is the default value of importance property for message task?

Message importance can have a value of high , normal or low . The default value is normal .

What is MSBuild target?

A target element can have both Inputs and Outputs attributes, indicating what items the target expects as input, and what items it produces as output. If all output items are up-to-date, MSBuild skips the target, which significantly improves the build speed. This is called an incremental build of the target.


1 Answers

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> 
like image 163
heavyd Avatar answered Sep 17 '22 13:09

heavyd