ISharePointProjectItemCollection.Add Method (String, String, String, Boolean)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Creates and adds a SharePoint project item to the project.
Namespace: Microsoft.VisualStudio.SharePoint
Assembly: Microsoft.VisualStudio.SharePoint (in Microsoft.VisualStudio.SharePoint.dll)
Syntax
'Declaration
Function Add ( _
path As String, _
name As String, _
projectItemType As String, _
skipAutoPackage As Boolean _
) As ISharePointProjectItem
ISharePointProjectItem Add(
string path,
string name,
string projectItemType,
bool skipAutoPackage
)
Parameters
path
Type: System.StringThe base path of the project item. Can be either relative to the project path or absolute.
name
Type: System.StringThe name of the project item. The name should be file system-friendly.
projectItemType
Type: System.StringThe type of the project item.
skipAutoPackage
Type: System.BooleanIf true, the project system will not automatically add a feature or package for the project item.
Return Value
Type: Microsoft.VisualStudio.SharePoint.ISharePointProjectItem
An instance of the new project item.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Occurs if any of the arguments are nulla null reference (Nothing in Visual Basic). |
ArgumentException | Occurs in the following cases:
|
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.