Compartir a través de


BuildItemGroup.AddNewItem Method (String, String, Boolean)

Adds a new BuildItem with the specified Name and Include property values to the BuildItemGroup, allowing you to specify whether the Include property value is treated as a literal.

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

Syntax

'Declaration
Public Function AddNewItem ( _
    itemName As String, _
    itemInclude As String, _
    treatItemIncludeAsLiteral As Boolean _
) As BuildItem
public BuildItem AddNewItem(
    string itemName,
    string itemInclude,
    bool treatItemIncludeAsLiteral
)
public:
BuildItem^ AddNewItem(
    String^ itemName, 
    String^ itemInclude, 
    bool treatItemIncludeAsLiteral
)
member AddNewItem : 
        itemName:string * 
        itemInclude:string * 
        treatItemIncludeAsLiteral:bool -> BuildItem
public function AddNewItem(
    itemName : String, 
    itemInclude : String, 
    treatItemIncludeAsLiteral : boolean
) : BuildItem

Parameters

  • treatItemIncludeAsLiteral
    Type: System.Boolean

    true to treat the itemInclude parameter as a literal value; otherwise, false.

Return Value

Type: Microsoft.Build.BuildEngine.BuildItem
The new BuildItem.

.NET Framework Security

See Also

Reference

BuildItemGroup Class

AddNewItem Overload

Microsoft.Build.BuildEngine Namespace