Closed tranceporter closed 5 years ago
For now I am getting around this by copying registration from Microsoft.Practices.Unity.IUnityContainer to Unity.IUnityContainer
foreach (var registration in currentContainer.Registrations) { container.RegisterType(registration.RegisteredType, registration.MappedToType); }
Microsoft.Practices.Unity.IUnityContainer
is being used up to v4.0.1.
Unity 5+ uses Unity.IUnityContainer
Hi,
I do realise that your notes mention that it is currently not possible to bootstrap the Startup class, but I am not sure if it's the same as the issue I am currently experiencing.
Program.cs has
Startup.cs has
When I run this and try to call an API, I get an exception
Is there any way around this? I am using version 2.0.10.
EDIT: Re-reading the exception, I just realised that it is trying to bootstrap IServiceProviderFactory from Microsoft.Practices.Unity.IUnityContainer which I am assuming is the wrong IUnityContainer? We currently have some in-house Nuget packages which are class libraries and reference Microsoft.Practices.Unity, and resolve themselves using a UnityBoostrapperModule and MEF. Is there anyway for Microsoft.Practices.Unity.IUnityContainer to co-exist with Unity.IUnityContainer?
Thanks, Shreyas