Share via


Solution.WithProjectMetadataReferences 方法

定义

使用指定的项目创建新的解决方案实例,以仅包含指定的元数据引用。

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

参数

projectId
ProjectId
metadataReferences
IEnumerable<MetadataReference>

返回

例外

metadataReferences 包含 null

metadataReferences 包含重复项。

解决方案不包含 projectId

适用于