Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 2.48 KB

message-task.md

File metadata and controls

62 lines (48 loc) · 2.48 KB
title ms.date ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid author ms.author manager ms.workload
Message Task | Microsoft Docs
11/04/2016
reference
VB
CSharp
C++
jsharp
MSBuild, Message task
Message task [MSBuild]
2293309d-42b6-46dc-9684-8c146f66bc28
ghogen
ghogen
jillfra
multiple

Message task

Logs a message during a build.

Parameters

The following 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.

Remarks

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 Obtain build logs.

By default, the message is sent to all registered loggers. The logger interprets the Importance parameter. Typically, a message set to high is sent when logger verbosity is set to xref:Microsoft.Build.Framework.LoggerVerbosity.Minimal or higher. A message set to low is sent when logger verbosity is set to xref:Microsoft.Build.Framework.LoggerVerbosity.Detailed.

In addition to the parameters listed above, this task inherits parameters from the xref:Microsoft.Build.Tasks.TaskExtension class, which itself inherits from the xref:Microsoft.Build.Utilities.Task class. For a list of these additional parameters and their descriptions, see TaskExtension base class.

Example

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>

See also