コード例 #1
0
        /// <summary>
        /// Entry point for debug of the service
        /// </summary>
        public static void Run()
        {
            DomoCoreService service = new DomoCoreService();

            service.OnStart(null);
            Console.ReadKey();
            service.OnStop();
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            var dataDirectory         = ConfigurationManager.AppSettings["DataDirectory"];
            var absoluteDataDirectory = Path.GetFullPath(dataDirectory);

            AppDomain.CurrentDomain.SetData("DataDirectory", absoluteDataDirectory);
#if DEBUG
            using (var db = new DomoContext())
            {
                db.Database.CreateIfNotExists();
            }

            DomoCoreService.Run();
#else
            ServiceBase[] servicesToRun;
            servicesToRun = new ServiceBase[]
            {
                new DomoCoreService()
            };
            ServiceBase.Run(servicesToRun);
#endif
        }