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

Mar 6, 2012 at 10:02 AM

I am getting this error when used unity

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

my code

 

void Application_Start(object sender, EventArgs e)
    {
        var container = new Microsoft.Practices.Unity.UnityContainer();
        var section = (Microsoft.Practices.Unity.Configuration.UnityConfigurationSection)ConfigurationManager.GetSection("unity");
        section.Configure(container, "defaultContainer");

        var serviceLocator = new Microsoft.Practices.Unity.UnityServiceLocator(container);
        Microsoft.Practices.ServiceLocation.ServiceLocator.SetLocatorProvider(() => serviceLocator);

    }

Mar 6, 2012 at 5:34 PM

IntrospectionExtensions is a new .NET 4.5 class.  What version of Unity are you using and what .NET Framework version is your web application targetting?  

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com