.NET Core 可以以以下方式作为宿主运行:
  1. IIS
  2. 控制台
  3. Windows服务
  运行启动代码:
        public static void Main(string[] args)
        {
            try
            {
                LogCenter.Info("系统启动");
                LoadConfig();
                bool isService = !(Debugger.IsAttached ||  args.Contains("--console"));
                if (isService)
                {
                    CreateWebHostBuilder(args).Build().RunAsService();
                }
                else
                {
                    CreateWebHostBuilder(args).Build().Run();
                }
            }
            catch (Exception ex)
            {
                LogCenter.Error(ex);
            }
        }

相关文章:

  • 2021-10-26
  • 2021-05-27
  • 2021-12-16
  • 2021-06-21
  • 2021-08-03
  • 2022-12-23
  • 2021-12-13
猜你喜欢
  • 2021-12-13
  • 2022-12-23
  • 2021-07-13
  • 2021-08-01
  • 2021-06-14
相关资源
相似解决方案