共用方式為


Solution.AddMetadataReference(ProjectId, MetadataReference) 方法

定義

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

public:
 Microsoft::CodeAnalysis::Solution ^ AddMetadataReference(Microsoft::CodeAnalysis::ProjectId ^ projectId, Microsoft::CodeAnalysis::MetadataReference ^ metadataReference);
public Microsoft.CodeAnalysis.Solution AddMetadataReference (Microsoft.CodeAnalysis.ProjectId projectId, Microsoft.CodeAnalysis.MetadataReference metadataReference);
member this.AddMetadataReference : Microsoft.CodeAnalysis.ProjectId * Microsoft.CodeAnalysis.MetadataReference -> Microsoft.CodeAnalysis.Solution
Public Function AddMetadataReference (projectId As ProjectId, metadataReference As MetadataReference) As Solution

參數

projectId
ProjectId
metadataReference
MetadataReference

傳回

例外狀況

metadataReferencenull

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

適用於