Solution.WithProjectReferences 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用指定的项目创建新的解决方案实例,以包含指定的项目引用列表。
public:
Microsoft::CodeAnalysis::Solution ^ WithProjectReferences(Microsoft::CodeAnalysis::ProjectId ^ projectId, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::ProjectReference ^> ^ projectReferences);
public Microsoft.CodeAnalysis.Solution WithProjectReferences (Microsoft.CodeAnalysis.ProjectId projectId, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ProjectReference> projectReferences);
public Microsoft.CodeAnalysis.Solution WithProjectReferences (Microsoft.CodeAnalysis.ProjectId projectId, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ProjectReference>? projectReferences);
member this.WithProjectReferences : Microsoft.CodeAnalysis.ProjectId * seq<Microsoft.CodeAnalysis.ProjectReference> -> Microsoft.CodeAnalysis.Solution
Public Function WithProjectReferences (projectId As ProjectId, projectReferences As IEnumerable(Of ProjectReference)) As Solution
参数
- projectId
- ProjectId
要替换为 projectReferences
的引用的项目的 ID。
- projectReferences
- IEnumerable<ProjectReference>
新项目引用。
返回
例外
projectReferences
包含 null
。
projectReferences
包含重复项。
解决方案不包含 projectId
。