I’m in the process of trying to update a bunch of NuGet packages in my solution and I’ve been avoiding updating Unity for a while. I’m close to having it updated to 5.x but I’m having trouble getting it to work with Hangfire.
My code looks like this:
var container = new Unity.UnityContainer();
...
GlobalConfiguration.Configuration.UseUnityActivator(container); <-- line 52
I’m getting this error:
Severity Code Description Project File Line Suppression State
Error CS0012 The type ‘IUnityContainer’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘Unity.Abstractions, Version=3.3.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f’. MyProj C:*****\App_Start\HangFireConfig.cs 52 Active
I suspect it’s some kind of version dependency either artificial (meaning it would work if the explicit requirement was not specified) or real (meaning the code needs to change before it supports it).
package versions:
Hangfire.Unity 3.0.0
Unity 5.11.2
Unity.Abstractions 5.11.2
Unity.Container 5.11.4
Unity.Mvc 5.11.1
Unity.Mvc5 v1.4.0
Unity.Web.API 5.4.0
Any help would be greatly appreciated.