Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Logs a message using the specified string and other message details.
Thread safe.
MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Namespace:  Microsoft.Build.Utilities
Assembly:  Microsoft.Build.Utilities.Core (in Microsoft.Build.Utilities.Core.dll)
Syntax
'Declaration
Public Sub LogMessage ( _
    subcategory As String, _
    code As String, _
    helpKeyword As String, _
    file As String, _
    lineNumber As Integer, _
    columnNumber As Integer, _
    endLineNumber As Integer, _
    endColumnNumber As Integer, _
    importance As MessageImportance, _
    message As String, _
    ParamArray messageArgs As Object() _
)
public void LogMessage(
    string subcategory,
    string code,
    string helpKeyword,
    string file,
    int lineNumber,
    int columnNumber,
    int endLineNumber,
    int endColumnNumber,
    MessageImportance importance,
    string message,
    params Object[] messageArgs
)
public:
void LogMessage(
    String^ subcategory, 
    String^ code, 
    String^ helpKeyword, 
    String^ file, 
    int lineNumber, 
    int columnNumber, 
    int endLineNumber, 
    int endColumnNumber, 
    MessageImportance importance, 
    String^ message, 
    ... array<Object^>^ messageArgs
)
member LogMessage : 
        subcategory:string * 
        code:string * 
        helpKeyword:string * 
        file:string * 
        lineNumber:int * 
        columnNumber:int * 
        endLineNumber:int * 
        endColumnNumber:int * 
        importance:MessageImportance * 
        message:string * 
        messageArgs:Object[] -> unit
public function LogMessage(
    subcategory : String, 
    code : String, 
    helpKeyword : String, 
    file : String, 
    lineNumber : int, 
    columnNumber : int, 
    endLineNumber : int, 
    endColumnNumber : int, 
    importance : MessageImportance, 
    message : String, 
    ... messageArgs : Object[]
)
Parameters
subcategory
Type: System.StringDescription of the warning type (can be null).
code
Type: System.StringMessage code (can be null)
helpKeyword
Type: System.StringThe help keyword for the host IDE (can be null).
file
Type: System.StringThe path to the file causing the message (can be null).
lineNumber
Type: System.Int32The line in the file causing the message (set to zero if not available).
columnNumber
Type: System.Int32The column in the file causing the message (set to zero if not available).
endLineNumber
Type: System.Int32The last line of a range of lines in the file causing the message (set to zero if not available).
endColumnNumber
Type: System.Int32The last column of a range of columns in the file causing the message (set to zero if not available).
importance
Type: Microsoft.Build.Framework.MessageImportanceImportance of the message.
message
Type: System.StringThe message string.
messageArgs
Type: array<System.Object[]Optional arguments for formatting the message string.
Exceptions
| Exception | Condition | 
|---|---|
| ArgumentNullException | Thrown when message is null.  | 
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.