Get Types in assembly (error: System.Reflection.ReflectionTypeLoadException)

你离开我真会死。 提交于 2019-11-30 17:23:13

The error message says everything you need, really:

try {
    // your code
} catch (ReflectionTypeLoadException ex) {
    // now look at ex.LoaderExceptions - this is an Exception[], so:
    foreach(Exception inner in ex.LoaderExceptions) {
        // write details of "inner", in particular inner.Message
    }
}

If you use the Entity Framework, check if version in Web.Config is the same referenced in your project.

Was the DLL created by you? Which framework are you targeting?

I've faced this problem just now. Even compiling my external libs with framework 3.5 (that uses CLR2), the DLL coudn't be imported. The error was the same as yours. I've solved my problem rebuilding my libs targeting framework 3.0 and seems to work now. I'm leaving my dlls in Plugins folder with no problems.

There are lots of similar problems in Unity forums.

Maybe you have the solution already, but this can help anyone who needs it in the future (like I needed).

Best Regards!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!