Share via


ProjectInstance.AddItem Method (String, String)

Adds an item with no metadata to the 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.

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

Syntax

'Declaration
Public Function AddItem ( _
    itemType As String, _
    evaluatedInclude As String _
) As ProjectItemInstance
public ProjectItemInstance AddItem(
    string itemType,
    string evaluatedInclude
)
public:
ProjectItemInstance^ AddItem(
    String^ itemType, 
    String^ evaluatedInclude
)
member AddItem : 
        itemType:string * 
        evaluatedInclude:string -> ProjectItemInstance
public function AddItem(
    itemType : String, 
    evaluatedInclude : String
) : ProjectItemInstance

Parameters

  • itemType
    Type: System.String

    The item type of the item to be added.

  • evaluatedInclude
    Type: System.String

    The evaluated Include attribute of the item.

Return Value

Type: Microsoft.Build.Execution.ProjectItemInstance
Returns the new item.

Remarks

We don't take a ProjectItemInstance to make sure we don't have one that's already in use by another ProjectInstance.

.NET Framework Security

See Also

Reference

ProjectInstance Class

AddItem Overload

Microsoft.Build.Execution Namespace