Partager via


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

Syntax

'Declaration
Public Function AddItem ( _
    itemType As String, _
    unevaluatedInclude As String _
) As IList(Of ProjectItem)
public IList<ProjectItem> AddItem(
    string itemType,
    string unevaluatedInclude
)
public:
IList<ProjectItem^>^ AddItem(
    String^ itemType, 
    String^ unevaluatedInclude
)
member AddItem : 
        itemType:string * 
        unevaluatedInclude:string -> IList<ProjectItem> 
public function AddItem(
    itemType : String, 
    unevaluatedInclude : String
) : IList<ProjectItem>

Parameters

  • unevaluatedInclude
    Type: System.String

    Include attribute of the item to be added.

Return Value

Type: IList<ProjectItem>
Returns the added item.

Remarks

Any metadata can be added later. Does not modify the project source if a wildcard expression already includes the new item.

Evaluation takes place on a best-effort basis. Items that are defined in the project source following the new item may be used for evaluation. Only this item is evaluated. Other items that might depend on it are not affected.

.NET Framework Security

See Also

Reference

Project Class

AddItem Overload

Microsoft.Build.Evaluation Namespace