protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); var formatters = GlobalConfiguration.Configuration.Formatters; formatters.Remove(formatters.XmlFormatter); var json = formatters.JsonFormatter; json.SerializerSettings.Formatting = Formatting.Indented; json.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); AutomaperWebProfile.Run(); GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(110); GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromSeconds(30); GlobalHost.Configuration.KeepAlive = TimeSpan.FromSeconds(10); ModelBinders.Binders.Add(typeof(DateTime), new DateTimeModelBinder()); ModelBinders.Binders.Add(typeof(DateTime?), new DateTimeModelBinder()); JobSheduler.Start(); }
public void Preload(string[] parameters) { try { JobSheduler.Start(); } catch { } }