Failed to load type 'System.Reflection.IntrospectionExtensions' from assembly' mscorlib

I am using Unity IoC (Microsoft.Practices.Unity) and I can compile everything, but at runtime I get the following error:

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

Unity Version: 3.0.1026.0

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

EDIT: Also, I confirmed that mscorlib is referenced in my project.

+4
source share
1 answer

RESOLVED.

Indeed, I used the .NET 4.5 preview version, which referenced a class that was not in my .NET 4.0 world. Thanks to Hans Passant for the amazing speed in which you spotted the problem!

+9
source

All Articles