Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 4
MSBuild Reference
 Message Task
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

Other versions are also available for the following:
.NET Framework 4
Message Task

Logs a message during a build.

The folowing table describes the parameters of the Message task.

Parameter

Description

Importance

Optional String parameter.

Specifies the importance of the message. This parameter can have a value of high, normal or low. The default value is normal.

Text

Optional String parameter.

The error text to log.

The Message task allows MSBuild projects to issue messages to loggers at different steps in the build process.

If the Condition parameter evaluates to true, the value of the Text parameter will be logged and the build will continue to execute. If a Condition parameter does not exist, the message text is logged. For more information on logging, see Overview of Logging in MSBuild.

By default, the message is sent to the MSBuild console logger. This can be changed by setting the Log parameter. The logger interprets the Importance parameter.

In addition to the parameters listed above, this task inherits parameters from the TaskExtension class, which itself inherits from the Task class. For a list of these additional parameters and their descriptions, see TaskExtension Base Class.

The following code example logs messages to all registered loggers.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="DisplayMessages">
        <Message Text="Project File Name = $(MSBuildProjectFile)" />
        <Message Text="Project Extension = $(MSBuildProjectExtension)" />
    </Target>
    ...
</Project>
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker