protected void Application_Start() { //注册Unity IUnityContainer container = new UnityContainer(); InitUnity(container); DependencyResolver.SetResolver(new UnityDependencyResolver(container)); container.RegisterType <IControllerActivator, ControllerActivator>(); AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); //注册静态资源 SourceManager.Configure(ConfigurationManager.AppSettings["StaticSourceConfigurationFilePath"]); //注册路由器 RouteManager.Configure(ConfigurationManager.AppSettings["RouterConfigurationFilePath"]); }