ServiceLocator.Current.GetInstance causes excessive number of calls to ObjectBuilder2.PolicyList.GetNoDefault
问题 In my MVC4, .NET4.5 web app using Unity IoC container, in the method IoCContainerFactory.GetControllerInstance() we use ServiceLocator.Current.GetInstance to get the controller instance: public class IoCControllerFactory : DefaultControllerFactory { protected override IController GetControllerInstance( System.Web.Routing.RequestContext requestContext, Type controllerType) { // snip other code // this is the problem line: return ServiceLocator.Current.GetInstance(controllerType) as IController