共用方式為


ProjectItem.GetMetadataValue Method

Get the evaluated value of the given metadata for this item, including metadata originating from an item definition.

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

Syntax

'Declaration
Public Function GetMetadataValue ( _
    name As String _
) As String
public string GetMetadataValue(
    string name
)
public:
virtual String^ GetMetadataValue(
    String^ name
) sealed
abstract GetMetadataValue : 
        name:string -> string  
override GetMetadataValue : 
        name:string -> string
public final function GetMetadataValue(
    name : String
) : String

Parameters

  • name
    Type: System.String

    The name of the metadata whose value is retrieved.

Return Value

Type: System.String
Returns the evaluated value of the given metadata for this item, including metadata originating from an item definition. Returns an empty string if no metadata exists with the given name.

Remarks

To determine whether metadata exist, whether it has a value or not, use HasMetadata.

This method may be used to access the value of built-in metadata, such as "FullPath".

.NET Framework Security

See Also

Reference

ProjectItem Class

Microsoft.Build.Evaluation Namespace