TaskLoggingHelper.LogWarning Method

Definition

Logs a warning.

Overloads

LogWarning(String, Object[])

Logs a warning using the specified string. Thread safe.

LogWarning(String, String, String, String, Int32, Int32, Int32, Int32, String, Object[])

Logs a warning using the specified string and other warning details. Thread safe.

LogWarning(String, String, String, String, String, Int32, Int32, Int32, Int32, String, Object[])

Logs a warning using the specified string and other warning details. Thread safe.

LogWarning(String, Object[])

Source:
TaskLoggingHelper.cs

Logs a warning using the specified string. Thread safe.

C#
public void LogWarning(string message, params object[] messageArgs);
C#
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void LogWarning(string message, params object[] messageArgs);

Parameters

message
String

The message string.

messageArgs
Object[]

Optional arguments for formatting the message string.

Attributes

Exceptions

Thrown when message is null.

Remarks

This method is not thread-safe.

Applies to

MSBuild 17 e altre versioni
Prodotto Versioni
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

LogWarning(String, String, String, String, Int32, Int32, Int32, Int32, String, Object[])

Source:
TaskLoggingHelper.cs

Logs a warning using the specified string and other warning details. Thread safe.

C#
public void LogWarning(string subcategory, string warningCode, string helpKeyword, string file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber, string message, params object[] messageArgs);

Parameters

subcategory
String

Description of the warning type (can be null).

warningCode
String

The warning code (can be null).

helpKeyword
String

The help keyword for the host IDE (can be null).

file
String

The path to the file causing the warning (can be null).

lineNumber
Int32

The line in the file causing the warning (set to zero if not available).

columnNumber
Int32

The column in the file causing the warning (set to zero if not available).

endLineNumber
Int32

The last line of a range of lines in the file causing the warning (set to zero if not available).

endColumnNumber
Int32

The last column of a range of columns in the file causing the warning (set to zero if not available).

message
String

The message string.

messageArgs
Object[]

Optional arguments for formatting the message string.

Exceptions

Thrown when message is null.

Remarks

The parameters subCategory, warningCode, helpKeyword, and file can be null.

The parameters lineNumber, columnNumber, endLineNumber, and endColumnNumber should be set to 0 if they are not available.

Applies to

MSBuild 17 e altre versioni
Prodotto Versioni
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

LogWarning(String, String, String, String, String, Int32, Int32, Int32, Int32, String, Object[])

Source:
TaskLoggingHelper.cs

Logs a warning using the specified string and other warning details. Thread safe.

C#
public void LogWarning(string subcategory, string warningCode, string helpKeyword, string helpLink, string file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber, string message, params object[] messageArgs);

Parameters

subcategory
String

Description of the warning type (can be null).

warningCode
String

The warning code (can be null).

helpKeyword
String

The help keyword for the host IDE (can be null).

helpLink
String

A link pointing to more information about the warning (can be null).

file
String

The path to the file causing the warning (can be null).

lineNumber
Int32

The line in the file causing the warning (set to zero if not available).

columnNumber
Int32

The column in the file causing the warning (set to zero if not available).

endLineNumber
Int32

The last line of a range of lines in the file causing the warning (set to zero if not available).

endColumnNumber
Int32

The last column of a range of columns in the file causing the warning (set to zero if not available).

message
String

The message string.

messageArgs
Object[]

Optional arguments for formatting the message string.

Exceptions

Thrown when message is null.

Applies to

MSBuild 17 e altre versioni
Prodotto Versioni
MSBuild 16, 17
MSBuild (.NET Core) 16, 17