ProjectItemInstance Class

Wraps an evaluated item for build purposes.

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.

Inheritance Hierarchy

System.Object
  Microsoft.Build.Execution.ProjectItemInstance

Namespace:  Microsoft.Build.Execution
Assembly:  Microsoft.Build (in Microsoft.Build.dll)

Syntax

'Declaration
Public Class ProjectItemInstance _
    Implements ITaskItem, ITaskItem2
public class ProjectItemInstance : ITaskItem, 
    ITaskItem2
public ref class ProjectItemInstance : ITaskItem, 
    ITaskItem2
type ProjectItemInstance =  
    class 
        interface ITaskItem 
        interface ITaskItem2 
    end
public class ProjectItemInstance implements ITaskItem, ITaskItem2

The ProjectItemInstance type exposes the following members.

Properties

  Name Description
Public property DirectMetadataCount Gets the number of pieces of metadata on this item.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.
Public property EvaluatedInclude Gets the evaluated Include attribute value. 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.
Public property ItemType Gets the item type, for example "Compile".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.
Public property Metadata Gets an enumerator over the evaluated metadata of the item. This is a read-only collection. 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.
Public property MetadataCount Gets the number of metadata entries, including metadata inherited from item definitions. 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.
Public property MetadataNames Gets all metadata names of this item, including metadata inherited from item definitions. 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.
Public property Project Gets the owning project.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.

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetMetadata Get the metadata with the given name, including metadata inherited from item definitions. 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.
Public method GetMetadataValue Gets the value of the metadata with the given name, including metadata inherited from item definitions. 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.
Public method GetType (Inherited from Object.)
Public method HasMetadata Determines whether the metadata with the given name is defined on this item (even if its value is empty string). 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.
Protected method MemberwiseClone (Inherited from Object.)
Public method RemoveMetadata Removes metadata with the given name. 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.
Public method SetMetadata(IEnumerable<KeyValuePair<String, String>>) Adds metadata with the given names and values. Overwrites any metadata with the same name already in the collection.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.
Public method SetMetadata(String, String) Add metadata with the given name and value. Overwrites any metadata with the same name already in the collection.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.
Public method ToString Gets a String that represents the current item.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. (Overrides Object.ToString().)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method ITaskItem.CloneCustomMetadata ITaskItem implementation. Gets the collection of custom metadata.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.
Explicit interface implemetationPrivate method ITaskItem.CopyMetadataTo ITaskItem implementation. Copies the custom metadata entries to another item.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.
Explicit interface implemetationPrivate method ITaskItem.GetMetadata ITaskItem implementation. Gets the value of the specified metadata entry.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.
Explicit interface implemetationPrivate property ITaskItem.ItemSpec ITaskItem implementation. Gets or sets the item specification.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.
Explicit interface implemetationPrivate property ITaskItem.MetadataNames ITaskItem implementation. Gets the names of the metadata entries associated with the item.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.
Explicit interface implemetationPrivate method ITaskItem.SetMetadata ITaskItem implementation. Adds or changes a custom metadata entry to the item.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.
Explicit interface implemetationPrivate method ITaskItem2.CloneCustomMetadataEscaped ITaskItem2 implementation. Returns a clone of the metadata on this object. Values returned are in their original escaped form.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.
Explicit interface implemetationPrivate property ITaskItem2.EvaluatedIncludeEscaped ITaskItem2 implementation. Evaluated include value, escaped as necessary. May be empty string. Gets or sets the item include value e.g. for disk-based items this would be the file path.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.
Explicit interface implemetationPrivate method ITaskItem2.GetMetadataValueEscaped ITaskItem2 implementation. Allows the values of metadata on the item to be queried.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.
Explicit interface implemetationPrivate method ITaskItem2.SetMetadataValueLiteral ITaskItem2 implementation. Allows a piece of custom metadata to be set on the item. Assumes that the value passed in is unescaped, and escapes the value as necessary in order to maintain its value.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.

Top

Remarks

Does not store item element information, because all evaluation and verification has already been performed.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Build.Execution Namespace