C# MetadataFileReference不可访问
我最近将我的项目更新为Roslyn 1.0,但在任何地方都找不到MetadataFileReference类C# MetadataFileReference不可访问,c#,roslyn,C#,Roslyn,我最近将我的项目更新为Roslyn 1.0,但在任何地方都找不到MetadataFileReference类 references: new[] { new MetadataFileReference(typeof(object).Assembly.Location) } Error CS0122 'MetadataFileReference' is inaccessible due to its protection level 我可以用什么来代替呢?对不起,在源代码中找到了答案:
references: new[] { new MetadataFileReference(typeof(object).Assembly.Location) }
Error CS0122 'MetadataFileReference' is inaccessible due to its protection level
我可以用什么来代替呢?对不起,在源代码中找到了答案:
references: new[] { MetadataReference.CreateFromAssembly(typeof(object).Assembly) }
已经过时了
你应该改用
哎呀。谢谢你,我的朋友。祝你好运。
references: new[] { MetadataReference.CreateFromFile(typeof(object).Assembly.Location) }