Sdílet prostřednictvím


TaskLoggingHelper.LogWarningWithCodeFromResources Method

Definition

Logs a warning with a warning code using the specified resource string.

Overloads

LogWarningWithCodeFromResources(String, Object[])

Logs a warning using the specified resource string. If the message has a warning code prefixed to it, the code is extracted and logged with the message. If a help keyword prefix has been provided, a help keyword for the host IDE is also logged with the message. The help keyword is composed by appending the string resource name to the prefix.

A task can provide a help keyword prefix either via the Task (or TaskMarshalByRef) base class constructor, or the Task.HelpKeywordPrefix (or AppDomainIsolatedTask.HelpKeywordPrefix) property.

Thread safe.

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

Logs a warning using the specified resource string and other warning details. If the message has a warning code, the code is extracted and logged with the message. If a help keyword prefix has been provided, a help keyword for the host IDE is also logged with the message. The help keyword is composed by appending the warning message resource string name to the prefix.

A task can provide a help keyword prefix either via the Task (or TaskMarshalByRef) base class constructor, or the Task.HelpKeywordPrefix (or AppDomainIsolatedTask.HelpKeywordPrefix) property.

Thread safe.

LogWarningWithCodeFromResources(String, Object[])

Source:
TaskLoggingHelper.cs

Logs a warning using the specified resource string. If the message has a warning code prefixed to it, the code is extracted and logged with the message. If a help keyword prefix has been provided, a help keyword for the host IDE is also logged with the message. The help keyword is composed by appending the string resource name to the prefix.

A task can provide a help keyword prefix either via the Task (or TaskMarshalByRef) base class constructor, or the Task.HelpKeywordPrefix (or AppDomainIsolatedTask.HelpKeywordPrefix) property.

Thread safe.

public:
 void LogWarningWithCodeFromResources(System::String ^ messageResourceName, ... cli::array <System::Object ^> ^ messageArgs);
public void LogWarningWithCodeFromResources (string messageResourceName, params object[] messageArgs);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void LogWarningWithCodeFromResources (string messageResourceName, params object[] messageArgs);
member this.LogWarningWithCodeFromResources : string * obj[] -> unit
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.LogWarningWithCodeFromResources : string * obj[] -> unit
Public Sub LogWarningWithCodeFromResources (messageResourceName As String, ParamArray messageArgs As Object())

Parameters

messageResourceName
String

The name of the string resource to load.

messageArgs
Object[]

Optional arguments for formatting the loaded string.

Attributes

Exceptions

Thrown when messageResourceName is null.

Remarks

If the message begins with a warning code, the code is extracted and logged with the message.

If a Help keyword prefix has been provided, it is also logged with the message. The Help keyword is composed by appending the string resource name to the Help keyword prefix. A task can provide a Help keyword prefix with either the Task base class constructor, or the HelpKeywordPrefix property.

Applies to

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

Source:
TaskLoggingHelper.cs

Logs a warning using the specified resource string and other warning details. If the message has a warning code, the code is extracted and logged with the message. If a help keyword prefix has been provided, a help keyword for the host IDE is also logged with the message. The help keyword is composed by appending the warning message resource string name to the prefix.

A task can provide a help keyword prefix either via the Task (or TaskMarshalByRef) base class constructor, or the Task.HelpKeywordPrefix (or AppDomainIsolatedTask.HelpKeywordPrefix) property.

Thread safe.

public:
 void LogWarningWithCodeFromResources(System::String ^ subcategoryResourceName, System::String ^ file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber, System::String ^ messageResourceName, ... cli::array <System::Object ^> ^ messageArgs);
public void LogWarningWithCodeFromResources (string subcategoryResourceName, string file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber, string messageResourceName, params object[] messageArgs);
member this.LogWarningWithCodeFromResources : string * string * int * int * int * int * string * obj[] -> unit
Public Sub LogWarningWithCodeFromResources (subcategoryResourceName As String, file As String, lineNumber As Integer, columnNumber As Integer, endLineNumber As Integer, endColumnNumber As Integer, messageResourceName As String, ParamArray messageArgs As Object())

Parameters

subcategoryResourceName
String

The name of the string resource that describes the warning type (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).

messageResourceName
String

The name of the string resource containing the warning message.

messageArgs
Object[]

Optional arguments for formatting the loaded string.

Exceptions

Thrown when messageResourceName is null.

Remarks

If the message begins with a warning code, the code is extracted and logged with the message.

If a Help keyword prefix has been provided, it is also logged with the message. The Help keyword is composed by appending the string resource name to the Help keyword prefix. A task can provide a Help keyword prefix with either the Task base class constructor, or the HelpKeywordPrefix property.

The parameters subCategoryResourceName, and file can be null.

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

Applies to