Project.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.Evaluation
Assembly: Microsoft.Build (in Microsoft.Build.dll)
Syntax
'Declaration
Public Function AddItem ( _
itemType As String, _
unevaluatedInclude As String, _
metadata As IEnumerable(Of KeyValuePair(Of String, String)) _
) As IList(Of ProjectItem)
public IList<ProjectItem> AddItem(
string itemType,
string unevaluatedInclude,
IEnumerable<KeyValuePair<string, string>> metadata
)
public:
IList<ProjectItem^>^ AddItem(
String^ itemType,
String^ unevaluatedInclude,
IEnumerable<KeyValuePair<String^, String^>>^ metadata
)
member AddItem :
itemType:string *
unevaluatedInclude:string *
metadata:IEnumerable<KeyValuePair<string, string>> -> IList<ProjectItem>
public function AddItem(
itemType : String,
unevaluatedInclude : String,
metadata : IEnumerable<KeyValuePair<String, String>>
) : IList<ProjectItem>
Parameters
itemType
Type: System.StringThe item type of the added item.
unevaluatedInclude
Type: System.StringInclude attribute of the item to be added.
Return Value
Type: IList<ProjectItem>
Returns the added item.
Remarks
The metadata may be null, which indicates no metadata.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.