如何从 Teamcity 构建步骤在 windows 服务器的后台 运行 Dotnet 运行

How to run Dotnet run in background on windows server from Teamcity build step

在 Teamcity 上的集成测试 运行ning 中,我正在尝试

使用 powershell 然后我尝试 运行 在后台使用

网络服务器
start-job -name someName -scriptblock {dotnet run}

但这给了我

16 someName BackgroundJob Completed True localhost dotnet run

但网络服务器未 运行ning 且输出无错误

还有其他方法可以使用 dotnet 命令在后台启动 kestrel 服务器吗?

找到解决方案

但是换成了使用编译版本的网络服务器而不是 dotnet 运行

这样做是为了启动我的网络服务器构建步骤

Start-Process .\someName.exe -NoNewWindow -PassThru

运行 测试

至此结束

Stop-Process -name YourServiceName

有效