protected virtual void Application_Start() { try { Cms.OnInit += CmsEventRegister.Init; Cms.Init(); } catch (Exception exc) { //Server.ClearError(); //if (HttpContext.Current.Response != null) //{ // HttpContext.Current.Response.Write("<html><head></head><body style=\"text-align:center\"><h1 style=\"\">" + exc.Message // + "</h1><hr /><span>ops.cms v" + Cms.Version // + "</span><span style=\"display:none\">" + exc.StackTrace + "</span>" // + "</body></html>"); // HttpRuntime.UnloadAppDomain(); //} //else //{ // throw new Exception(exc.Message); //} try { if (HttpContext.Current.Response != null) { HttpContext.Current.Response.Write( "<html><head></head><body style=\"text-align:center\"><h1 style=\"\">" + exc.Message + "</h1><hr /><span>ops.cms v" + Cms.Version + "</span><span style=\"display:none\">" + exc.StackTrace + "</span>" + "</body></html>"); Server.ClearError(); } } catch { } finally { HttpRuntime.UnloadAppDomain(); } return; } //注册路由; RouteCollection routes = RouteTable.Routes; routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //注册自定义路由 RegisterRoutes(routes); //注册CMS路由 Routes.RegisterCmsRoutes(routes, null); //RouteDebug.RouteDebugger.RewriteRoutesForTesting(routes); //注册定时任务 CmsTask.Init(); }
protected virtual void Application_Start() { try { Cms.OnInit += CmsEventRegister.Init; Cms.Init(); } catch (Exception exc) { if (exc.InnerException != null) { exc = exc.InnerException; } try { HttpContext.Current.Response.Write(@"<html><head></head> <body style=""text-align:center""><h1 style="""">" + exc.Message + "</h1><hr /><span>ops.cms v" + Cms.Version + "</span><span style=\"display:none\">" + exc.StackTrace + "</span>" + "</body></html>"); Server.ClearError(); } catch (Exception ex) { throw exc; } finally { HttpRuntime.UnloadAppDomain(); } return; } //注册路由; RouteCollection routes = RouteTable.Routes; routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //注册自定义路由 RegisterRoutes(routes); //注册CMS路由 Routes.RegisterCmsRoutes(routes, null); //RouteDebug.RouteDebugger.RewriteRoutesForTesting(routes); //注册定时任务 CmsTask.Init(); //加载自定义插件 //Cms.Plugins.Extends.LoadFromAssembly(typeof(sp.datapicker.CollectionExtend).Assembly); }