ISharePointProjectOutputReferenceCollection.Add 方法 (Guid, DeploymentType)
将输出引用添加到由 projectId 指定的项目中。 该引用作为生成依赖项添加到当前项目,并被纳入到 SharePoint 项目项中。
命名空间: Microsoft.VisualStudio.SharePoint
程序集: Microsoft.VisualStudio.SharePoint(在 Microsoft.VisualStudio.SharePoint.dll 中)
语法
声明
Function Add ( _
projectId As Guid, _
deploymentType As DeploymentType _
) As ISharePointProjectOutputReference
ISharePointProjectOutputReference Add(
Guid projectId,
DeploymentType deploymentType
)
参数
- projectId
类型:System.Guid
Visual Studio 解决方案中的每个项目具有唯一 ID。此参数表示要作为引用添加的项目的 ID。应将由 projectId 指定的项目加载到解决方案中,以便此方法可正常工作。
- deploymentType
类型:Microsoft.VisualStudio.SharePoint.DeploymentType
由 DeploymentType 枚举值指定的一种部署类型。
返回值
类型:Microsoft.VisualStudio.SharePoint.ISharePointProjectOutputReference
添加的引用。
异常
异常 | 条件 |
---|---|
ArgumentException | 当找不到具有指定的 projectId 的项目时发生。 |
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。