我不能用netcore扩展“Assembly”类

时间:2017-01-29 01:47:23

标签: c#

我想像这样扩展类程序集:

using System.Reflection;
namespace MyNamespace
{
    public class ShadowAssembly : Assembly
    {
        public override IEnumerable<TypeInfo> DefinedTypes { get { return null; } }
        public override IEnumerable<Module> Modules { get { return null; } }
    }
}

我使用.NetStandard 1.6

{
  "dependencies": { "NETStandard.Library": "1.6.1-*", ...},
  "frameworks": {
    "netstandard1.6": { "imports": "dnxcore50" }
  }...
}

但我有错误:

CS1729 C# 'Assembly' does not contain a constructor that takes 0 arguments

为什么我有这个错误?当我看看Assembly类的源代码时,它只是一个没有任何构造函数的抽象类......

如果这是正常的话,我怎么能避开这个问题呢? (我在dotnetcore中找不到RealProxy。)

0 个答案:

没有答案