那是因为
Assembly
是基类,则在运行时(在此特定设置中)返回的实际对象是
RuntimeAssembly
哪一个
做
实施该方法。
取决于您如何获得
装配
对象,有不同的实际类型在起作用,无论是用于实际运行时代码还是仅用于反射探索或诸如此类。
但是
装配
是基类。
我可以毫不含糊地说,因为
装配
类是抽象的,从
reference source
:
public abstract class Assembly : _Assembly, IEvidenceFactory, ICustomAttributeProvider, ISerializable
而且
documented
:
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Assembly : System.Reflection.ICustomAttributeProvider, System.Runtime.InteropServices._Assembly, System.Runtime.Serialization.ISerializable, System.Security.IEvidenceFactory
因此,任何符合
装配
变量必须是派生类。