Project.AddNewItem Method (String, String, Boolean)
Adds the specified Item element 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.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
itemName
Type: System.StringThe name of the item collection to add the item to. Corresponds to the user-defined name of the Item element.
itemInclude
Type: System.StringThe value of the Include attribute of the item.
treatItemIncludeAsLiteral
Type: System.Booleantrue to treat the itemInclude parameter as a literal value; otherwise, false.
Return Value
Type: Microsoft.Build.BuildEngine.BuildItem
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.