Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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();
        }