共用方式為


Solution.AddMetadataReferences 方法

定義

使用指定的專案來建立新的方案實例,以包含指定的中繼資料參考。

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

參數

projectId
ProjectId
metadataReferences
IEnumerable<MetadataReference>

傳回

例外狀況

metadataReferences 包含 null

metadataReferences 包含重複的專案。

專案已經包含指定的參考。

適用於