元数据文件引用不可访问。

9

我最近将我的项目更新到了Roslyn 1.0,但无法在任何地方找到MetadataFileReference类。

references: new[] { new MetadataFileReference(typeof(object).Assembly.Location) }

Error   CS0122  'MetadataFileReference' is inaccessible due to its protection level

我该使用什么替代方案?

2个回答

12

抱歉,在源代码中找到了答案:

references: new[] { MetadataReference.CreateFromAssembly(typeof(object).Assembly) }

9

哎呀,谢谢你,我的朋友。祝你好运。 - user1908746

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接