示例#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);
            }
        }
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            UnityConfiguration.ConfigureIoCContainer();
        }