Project.AddNewItem Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the specified element to the project.
Overloads
AddNewItem(String, String) |
Adds the specified Item element to the project. |
AddNewItem(String, String, Boolean) |
Adds the specified Item element to the project. |
AddNewItem(String, String)
Adds the specified Item element to the project.
public:
Microsoft::Build::BuildEngine::BuildItem ^ AddNewItem(System::String ^ itemName, System::String ^ itemInclude);
public Microsoft.Build.BuildEngine.BuildItem AddNewItem (string itemName, string itemInclude);
member this.AddNewItem : string * string -> Microsoft.Build.BuildEngine.BuildItem
Public Function AddNewItem (itemName As String, itemInclude As String) As BuildItem
Parameters
- itemName
- String
The name of the item collection to add the item to. Corresponds to the user-defined name of the Item
element.
- itemInclude
- String
The value of the Include
attribute of the item.
Returns
A BuildItem containing the created item.
Remarks
This method attempts to add the item to the project near the other items in the item collection.
Applies to
AddNewItem(String, String, Boolean)
Adds the specified Item element to the project.
public:
Microsoft::Build::BuildEngine::BuildItem ^ AddNewItem(System::String ^ itemName, System::String ^ itemInclude, bool treatItemIncludeAsLiteral);
public Microsoft.Build.BuildEngine.BuildItem AddNewItem (string itemName, string itemInclude, bool treatItemIncludeAsLiteral);
member this.AddNewItem : string * string * bool -> Microsoft.Build.BuildEngine.BuildItem
Public Function AddNewItem (itemName As String, itemInclude As String, treatItemIncludeAsLiteral As Boolean) As BuildItem
Parameters
- itemName
- String
The name of the item collection to add the item to. Corresponds to the user-defined name of the Item
element.
- itemInclude
- String
The value of the Include
attribute of the item.
- treatItemIncludeAsLiteral
- Boolean
true
to treat the itemInclude
parameter as a literal value; otherwise, false
.
Returns
A BuildItem containing the created item.
Remarks
This method attempts to add the item to the project near the other items in the item collection.