Partager via


TaskLoggingHelperExtension.FormatResourceString Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

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

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.Tasks
Assembly:  Microsoft.Build.Tasks.Core (in Microsoft.Build.Tasks.Core.dll)

Syntax

'Declaration
Public Overrides Function FormatResourceString ( _
    resourceName As String, _
    ParamArray args As Object() _
) As String
public override string FormatResourceString(
    string resourceName,
    params Object[] args
)
public:
virtual String^ FormatResourceString(
    String^ resourceName, 
    ... array<Object^>^ args
) override
abstract FormatResourceString : 
        resourceName:string * 
        args:Object[] -> string  
override FormatResourceString : 
        resourceName:string * 
        args:Object[] -> string
public override function FormatResourceString(
    resourceName : String, 
    ... args : Object[]
) : String

Parameters

  • resourceName
    Type: System.String

    The name of the string resource to load.

  • args
    Type: array<System.Object[]

    Optional arguments for formatting the loaded string, or nulla null reference (Nothing in Visual Basic).

Return Value

Type: System.String
The formatted string.

Remarks

This method requires the owner task to have registered its resources either via the Task base class constructor, or one of the following properties: TaskResources or TaskResources.

This method is thread-safe.

.NET Framework Security

See Also

Reference

TaskLoggingHelperExtension Class

Microsoft.Build.Tasks Namespace