Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load type 'System.Reflection.IntrospectionExtensions' from assembly '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.

like image 841
Didaxis Avatar asked Jan 18 '23 09:01

Didaxis


1 Answers

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!

like image 86
Didaxis Avatar answered Feb 22 '23 23:02

Didaxis