共用方式為


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 包含重複的專案。

新增專案參考會建立迴圈相依性。

適用於