ProjectInstance.AddItem Method (String, String, IEnumerable<KeyValuePair<String, String>>)
Adds an item with the given 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, _
metadata As IEnumerable(Of KeyValuePair(Of String, String)) _
) As ProjectItemInstance
public ProjectItemInstance AddItem(
string itemType,
string evaluatedInclude,
IEnumerable<KeyValuePair<string, string>> metadata
)
public:
ProjectItemInstance^ AddItem(
String^ itemType,
String^ evaluatedInclude,
IEnumerable<KeyValuePair<String^, String^>>^ metadata
)
member AddItem :
itemType:string *
evaluatedInclude:string *
metadata:IEnumerable<KeyValuePair<string, string>> -> ProjectItemInstance
public function AddItem(
itemType : String,
evaluatedInclude : String,
metadata : IEnumerable<KeyValuePair<String, String>>
) : ProjectItemInstance
Parameters
itemType
Type: System.StringThe item type of the item to be added.
evaluatedInclude
Type: System.StringThe evaluated Include attribute of the item.
Return Value
Type: Microsoft.Build.Execution.ProjectItemInstance
Return 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.