无法加载类型“System.Reflection.IntrospectionExtensions”来自程序集 mscorlib
我正在使用 Unity IoC (Microsoft.Practices.Unity) 并且可以正常编译,但在运行时出现以下错误:
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
.Net 4 与此之间是否存在兼容性问题统一版本。另外,我在使用 Unity v2 时遇到同样的错误。如果是这样,我该如何解决这个问题?
编辑: 另外,我已经验证了我的项目中引用了 mscorlib。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已解决。
事实上,我使用的是 .NET 4.5 预览版,它引用了我的 .NET 4.0 世界中不存在的类。感谢 Hans Passant 以惊人的速度发现了问题!
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!