共用方式為


ProjectMetadata.Predecessor Property

Gets the last metadata (from an item definition or item) that was overridden by this metadata during evaluation.

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 ReadOnly Property Predecessor As ProjectMetadata
public ProjectMetadata Predecessor { get; }
public:
property ProjectMetadata^ Predecessor {
    ProjectMetadata^ get ();
}
member Predecessor : ProjectMetadata with get
function get Predecessor () : ProjectMetadata

Property Value

Type: Microsoft.Build.Evaluation.ProjectMetadata
Returns the last metadata (from an item definition or item) whose value was overridden by this metadata during evaluation. Returns null if the metadata has not been overridden.

Remarks

This method searches for all metadata with the same name that lie above in the logical project file, and which are contained by item definitions of the same item type, and whose conditions evaluate to true. If the metadata is contained by an item, this method searches for any previous metadata with the same name and item whose condition evaluated to true. Item definitions are searched before items.

If the project has not been reevaluated since the last modification, this value may be incorrect.

.NET Framework Security

See Also

Reference

ProjectMetadata Class

Microsoft.Build.Evaluation Namespace