Solution.AddProjectReferences 方法

定义

使用指定的项目创建新的解决方案实例,以包含指定的项目引用。

public:
 Microsoft::CodeAnalysis::Solution ^ AddProjectReferences(Microsoft::CodeAnalysis::ProjectId ^ projectId, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::ProjectReference ^> ^ projectReferences);
public Microsoft.CodeAnalysis.Solution AddProjectReferences (Microsoft.CodeAnalysis.ProjectId projectId, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ProjectReference> projectReferences);
member this.AddProjectReferences : Microsoft.CodeAnalysis.ProjectId * seq<Microsoft.CodeAnalysis.ProjectReference> -> Microsoft.CodeAnalysis.Solution
Public Function AddProjectReferences (projectId As ProjectId, projectReferences As IEnumerable(Of ProjectReference)) As Solution

参数

projectId
ProjectId
projectReferences
IEnumerable<ProjectReference>

返回

例外

projectReferences 包含 null

projectReferences 包含重复项。

添加项目引用将创建循环依赖项。

适用于