WorkerServices写好后准备部署到服务器上
nugit 安装包 Microsoft.Extensions.Hosting.WorkerServices
Program.cs中添加.UseWindowsService()
安装和启动服务
sc.exe create 服务名 binpath= 服务exe文件地址 sc.exe start 服务名
好了