Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
获取程序集中的类型:ReflectionTypeLoad异常_Reflection_C# 4.0_Assembly.reflectiononly - Fatal编程技术网

获取程序集中的类型:ReflectionTypeLoad异常

获取程序集中的类型:ReflectionTypeLoad异常,reflection,c#-4.0,assembly.reflectiononly,Reflection,C# 4.0,Assembly.reflectiononly,可能重复: 我想在加载的程序集中获取所有类型 Assembly assemblyObj = Assembly.LoadFile(@"D:\abc\abc.dll"); IList<Type> types = assemblyObj.GetTypes(); assemblyObj=Assembly.LoadFile(@“D:\abc\abc.dll”); IList types=assemblyObj.GetTypes(); 当我运行im getting

可能重复:

我想在加载的程序集中获取所有类型

Assembly assemblyObj = Assembly.LoadFile(@"D:\abc\abc.dll");
            IList<Type> types = assemblyObj.GetTypes();
assemblyObj=Assembly.LoadFile(@“D:\abc\abc.dll”);
IList types=assemblyObj.GetTypes();

当我运行im getting ReflectionTypeLoadException时。代码中有什么错误。

正如您在我对链接为duplicate的问题的回答中所看到的,问题很可能是,“abc.dll”包含从引用程序集中的类派生的类,而引用的程序集中不包含该基类,因为它有错误的版本