Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

In a integrationtest running on Teamcity I am trying to

  • Launch a ASPNET Core app using dotnet run
  • Run Integration test
  • Stop webserver

Using powershell I am then trying to run the webserver in the background using

start-job -name someName -scriptblock {dotnet run}

But this just gives me

16 someName BackgroundJob Completed True localhost dotnet run

But the webserver is not running and no error is outputtet

Is there another way to launch a kestrel server in the background using dotnet command?

like image 571
Mech0z Avatar asked Nov 08 '22 17:11

Mech0z


1 Answers

Found a solution

But swapped to using the compiled version of the webserver instead of dotnet run

Doing this to launch my webserver build step

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

Run tests

And this to end it

Stop-Process -name YourServiceName

Works

like image 62
Mech0z Avatar answered Nov 14 '22 21:11

Mech0z