TaskLoggingHelper.FormatResourceString(String, Object[]) Method

Definition

Loads the specified resource string and optionally formats it using the given arguments. The current thread's culture is used for formatting.

Requires the owner task to have registered its resources either via the Task (or TaskMarshalByRef) base class constructor, or the Task.TaskResources (or AppDomainIsolatedTask.TaskResources) property.

Thread safe.

C#
public virtual string FormatResourceString(string resourceName, params object[] args);

Parameters

resourceName
String

The name of the string resource to load.

args
Object[]

Optional arguments for formatting the loaded string.

Returns

The formatted string.

Exceptions

Thrown when resourceName is null.

Thrown when the string resource indicated by resourceName does not exist.

Thrown when the TaskResources property of the owner task is not set.

Remarks

The culture of the current thread is used for formatting.

This method requires the owner task to have registered its resources with either the Task base class constructor, or the TaskResources property.

Applies to

Proizvod Verzije
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1