共用方式為


Solution.WithProjectReferences 方法

定義

使用指定的專案來建立新的方案實例,以包含指定的專案參考清單。

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 為 之參考的專案識別碼。

projectReferences
IEnumerable<ProjectReference>

新的專案參考。

傳回

例外狀況

projectReferences 包含 null

projectReferences 包含重複的專案。

方案不包含 projectId

適用於