Ejemplo n.º 1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            #region 依赖注入
            // 应用程序下上文
            applicationContext = new ClassPathXmlApplicationContext(Path.Combine(HttpRuntime.AppDomainAppPath, "Bean_Config.xml"));
            // 重写ControllerFactory以便于注入
            ControllerBuilder.Current.SetControllerFactory(
                new XInjectControllerFactory()
            {
                applicationContext = applicationContext
            });
            #endregion

            #region 使用框架
            BaseException.Init(HttpRuntime.AppDomainAppPath);
            LogHelper.Init();
            #endregion

            System.Net.ServicePointManager.ServerCertificateValidationCallback =
                (sender, certificate, chain, errors) => true;

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
        }
Ejemplo n.º 2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            #region 使用框架
            BaseException.Init(HttpRuntime.AppDomainAppPath);
            LogHelper.Init();
            #endregion

            System.Net.ServicePointManager.ServerCertificateValidationCallback =
                (sender, certificate, chain, errors) => true;

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
        }
Ejemplo n.º 3
0
        protected void Application_Start(object sender, EventArgs e)
        {
            #region 依赖注入
            // 应用程序下上文
            applicationContext = new ClassPathXmlApplicationContext(Path.Combine(HttpRuntime.AppDomainAppPath, "Bean_Config.xml"));
            //// 重写ControllerFactory以便于注入
            //ControllerBuilder.Current.SetControllerFactory(
            //    new XInjectControllerFactory()
            //    {
            //        applicationContext = applicationContext
            //    });
            #endregion

            #region 使用框架
            BaseException.Init(HttpRuntime.AppDomainAppPath);
            LogHelper.Init();
            #endregion

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
        }