Question:
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
1 2 |
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?
Answer:
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
1 2 |
Start-Process .\someName.exe -NoNewWindow -PassThru |
Run tests
And this to end it
1 2 |
Stop-Process -name YourServiceName |
Works