public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseDeveloperExceptionPage(); app.UseStaticFiles(); app.UseMvc(); GlobalConfig.Environment = Configuration["Environment"]; ErrorCodeDescriptor.AddErrorCodeTypes(typeof(ErrorCode)); XDI.Run(); }
static void Main(String[] args) { XDI.Run(); GlobalConfig.Environment = ConfigurationManager.AppSettings["Environment"]; String jobsConfigFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "CPI.ScheduleJobs.Development.config"); if (GlobalConfig.Environment == EnvironmentType.Production.ToString()) { jobsConfigFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "CPI.ScheduleJobs.config"); } var service = new QuartzService(jobsConfigFilePath); service.Start(null); Console.WriteLine("CPI定时调度服务已启动..."); Console.ReadKey(); }