Partilhar via


TaskLoggingHelper.LogErrorWithCodeFromResources Method

Definition

Logs an error with an error code using the specified resource string.

Overloads

LogErrorWithCodeFromResources(String, Object[])

Logs an error using the specified resource string. If the message has an error 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.

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

Logs an error using the specified resource string and other error details. If the message has an error code prefixed, 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 error 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.

LogErrorWithCodeFromResources(String, Object[])

Source:
TaskLoggingHelper.cs

Logs an error using the specified resource string. If the message has an error 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 LogErrorWithCodeFromResources(System::String ^ messageResourceName, ... cli::array <System::Object ^> ^ messageArgs);
public void LogErrorWithCodeFromResources (string messageResourceName, params object[] messageArgs);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void LogErrorWithCodeFromResources (string messageResourceName, params object[] messageArgs);
member this.LogErrorWithCodeFromResources : string * obj[] -> unit
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.LogErrorWithCodeFromResources : string * obj[] -> unit
Public Sub LogErrorWithCodeFromResources (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 an error 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

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

Source:
TaskLoggingHelper.cs

Logs an error using the specified resource string and other error details. If the message has an error code prefixed, 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 error 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 LogErrorWithCodeFromResources(System::String ^ subcategoryResourceName, System::String ^ file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber, System::String ^ messageResourceName, ... cli::array <System::Object ^> ^ messageArgs);
public void LogErrorWithCodeFromResources (string subcategoryResourceName, string file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber, string messageResourceName, params object[] messageArgs);
member this.LogErrorWithCodeFromResources : string * string * int * int * int * int * string * obj[] -> unit
Public Sub LogErrorWithCodeFromResources (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 error type (can be null).

file
String

The path to the file containing the error (can be null).

lineNumber
Int32

The line in the file where the error occurs (set to zero if not available).

columnNumber
Int32

The column in the file where the error occurs (set to zero if not available).

endLineNumber
Int32

The last line of a range of lines in the file where the error occurs (set to zero if not available).

endColumnNumber
Int32

The last column of a range of columns in the file where the error occurs (set to zero if not available).

messageResourceName
String

The name of the string resource containing the error message.

messageArgs
Object[]

Optional arguments for formatting the loaded string.

Exceptions

Thrown when messageResourceName is null.

Remarks

If the message begins with an error 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