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

返回

例外

metadataReference 上声明的默认值为 null

项目已包含指定的引用。

适用于