.net core 使用运行时启动.NET Core 3.1 Worker作为Windows服务
为了将.NET Core 3.x Worker服务安装为Windows服务,在我遇到的每一个示例中,似乎总是强制使用Windows可执行文件发布应用程序,然后在Windows控制台上使用.net core 使用运行时启动.NET Core 3.1 Worker作为Windows服务,.net-core,windows-services,.net Core,Windows Services,为了将.NET Core 3.x Worker服务安装为Windows服务,在我遇到的每一个示例中,似乎总是强制使用Windows可执行文件发布应用程序,然后在Windows控制台上使用sc命令,如下所示: sc create workertest binPath=c:\code\workerpub\WorkerTest.exe (来源:) 相反,我尝试了以下方法: 在不指定运行时的情况下发布辅助服务(因此,仅获取项目dll) 使用dotnet命令创建Windows服务,如下所示:sc cre
sc
命令,如下所示:
sc create workertest binPath=c:\code\workerpub\WorkerTest.exe
(来源:)
相反,我尝试了以下方法:
dotnet
命令创建Windows服务,如下所示:sc create workertest binPath=“dotnet c:\code\workerpub\workertest.dll”