protected void Application_BeginRequest(object sender, EventArgs e) { if (!StaticResourcesConfig.IsInitialized) { try { StaticResourcesConfig.RegisterStaticResources(Settings.Default.UserFilePath, Settings.Default.TweetFilePath); } catch (Exception ex) { HttpContext.Current.Items["Error"] = ex; HttpContext.Current.RewritePath("~/Error"); } } }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); try { StaticResourcesConfig.RegisterStaticResources(Settings.Default.UserFilePath, Settings.Default.TweetFilePath); } catch (Exception /*ex*/) { //TODO: Log exception. } }