Just fixed this during an upgrade, here's my UnityWebActivator
container.RegisterType<UmbracoContext>(new ContainerControlledLifetimeManager(), new InjectionFactory(c => UmbracoContext.Current));container.RegisterType<UmbracoAuthorizeAttribute>(new ContainerControlledLifetimeManager(), new InjectionConstructor(typeof(UmbracoContext))); //prefer the constructor that takes UmbracoContext
Umbraco 7.11 and Unity.Mvc 5.0, Unity.AspNet.WebApi 5.0
What is the correct way to use Unity 5.0 with Umbraco 7.11?
When I use Unity from Nuget backoffice stops to work (shows blank page).
When I comment lines UnityMvcActivator.cs:
the backoffice works okay.
When I login to backoffice one of the requests is:
http://umbraco.tutorial.com/umbraco/ServerVariables?umb__rnd=733e9a4f5fd56cd839cc3f2a9739803f
returns message:
The type UmbracoAuthorizeAttribute has multiple constructors of length 1. Unable to disambiguate.
Just fixed this during an upgrade, here's my UnityWebActivator
container.RegisterType<UmbracoContext>(new ContainerControlledLifetimeManager(), new InjectionFactory(c => UmbracoContext.Current));
container.RegisterType<UmbracoAuthorizeAttribute>(new ContainerControlledLifetimeManager(), new InjectionConstructor(typeof(UmbracoContext))); //prefer the constructor that takes UmbracoContext
is working on a reply...