Exemple #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            try
            {
                log4net.Config.XmlConfigurator.Configure(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "Spooler.exe.config"));
                Mapper.Initialize(c => AutomapperConf.Mapping(c));
                UnityConfiguration.ConfigureIoCContainer();
                var _container = UnityConfiguration.container;
                _log = _container.Resolve <ILog>();
                _log.Info("Started");
#if DEBUG
                new MainClss();
                Thread.Sleep(Timeout.Infinite);
#else
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new MainClss()
                };
                ServiceBase.Run(ServicesToRun);
#endif
            }
            catch (Exception ex)
            {
                _log.Error(ex);
            }
        }
 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app, IHostingEnvironment env)
 {
     if (env.IsDevelopment())
     {
         app.UseBrowserLink();
         app.UseDeveloperExceptionPage();
     }
     else
     {
         app.UseExceptionHandler("/Home/Error");
     }
     app.UseStaticFiles();
     app.UseCors("AllowAllPolicy");
     app.UseMvc(routes =>
     {
         routes.MapRoute(
             name: "default",
             template: "API/{controller=Home}/{action=Index}/{id?}");
     });
     app.UseResponseCompression();
     Mapper.Initialize(c => AutomapperConf.Mapping(c));
 }