Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'mscorlib

谁说胖子不能爱 提交于 2019-12-22 08:29:58

问题


I'm using Unity IoC (Microsoft.Practices.Unity) and I can compile fine, but I'm getting the following error at run time:

Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

The Unity version is: 3.0.1026.0

Is there a compatibility problem between .Net 4 and this version of Unity. Also, I get the same error when using Unity v2. If so, how might I go about resolving this issue?

EDIT: Also, I've verified that mscorlib is referenced in my project.


回答1:


RESOLVED.

Indeed I was using the .NET 4.5 preview version, which was referencing a class that didn't exist in my .NET 4.0 world. Thanks Hans Passant for the amazing speed in which you identified the problem!



来源:https://stackoverflow.com/questions/7932994/could-not-load-type-system-reflection-introspectionextensions-from-assembly-m

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