다음을 통해 공유


TaskLoggingHelper.FormatResourceString Method

Loads the specified resource string and optionally formats it using the given arguments.

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

Syntax

'Declaration
Public Overridable Function FormatResourceString ( _
    resourceName As String, _
    ParamArray args As Object() _
) As String
public virtual string FormatResourceString(
    string resourceName,
    params Object[] args
)
public:
virtual String^ FormatResourceString(
    String^ resourceName, 
    ... array<Object^>^ args
)
abstract FormatResourceString : 
        resourceName:string * 
        args:Object[] -> string  
override FormatResourceString : 
        resourceName:string * 
        args:Object[] -> string
public 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.

Return Value

Type: System.String
The formatted string.

Exceptions

Exception Condition
ArgumentException

The string resource indicated by resourceName does not exist.

InvalidOperationException

The TaskResources property of the owner task is not set.

ArgumentNullException

resourceName is nulla null reference (Nothing in Visual Basic).

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.

.NET Framework Security

See Also

Reference

TaskLoggingHelper Class

Microsoft.Build.Utilities Namespace