0
votes

System.TypeLoadException: 'Method 'IsRegistered' in type 'Unity.UnityContainer' from assembly 'Unity.Container, Version=5.1.1.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0' does not have an implementation.'

I am getting the above error in my .NET MVC application when performing dependency injection through unity.

 public override void Application_Start()
        {
            WebApiConfig.Register(RouteTable.Routes, GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
         //...more code
            UnityConfig.RegisterComponents();//ERROR-->break point inside of RegisterComponents() doesn't even get hit  
        }
1
5.1.1 isn't available through package manager. Two days after it was released they went to 5.1.2. That tells me something was wrong with 5.1.1. Through random bad timing this package must have been added during a two-day window in December 2017. Try updating your package to the latest version. - Scott Hannen
@ScottHannen Yup! That did the trick. Thanks. - SamuraiJack

1 Answers

0
votes

This method is an extension, so it is quite possibly from another assembly than the class itself. Make sure you have reference of Microsoft.Practices.Unity.Silverlight package in the project that contains the composition root (DI container registrations).