How to run iisexpress in background

  asp.net-core, batch-file, iis-express, windows

I am trying to run my asp.net core web app on iisexpress using a batch file. Here is the content of the batch file:

SET ASPNETCORE_ENVIRONMENT=Development SET
LAUNCHER_PATH=C:UsersAdministratorDocumentsmyappbinx64Debugnetcoreapp3.1myapp.exe
cd /d "C:Program FilesIIS Express" iisexpress.exe
/config:"C:UsersAdministratorDocumentsmyapp.vsmyappconfigapplicationhost.config"
/site:"myapp" /apppool:"myapp AppPool"

This batch script successfully starting my app on IIS Express, but it is running in the foreground, with a command prompt open having the application logs in it.
How can I run my application in the background so that I don’t have to face the command prompt

I’ve tried one of the solution given in
How to run iisexpress in the background without blocking script?

And made changes in the command:

start /wait iisexpress.exe
/config:"C:UsersAdministratorDocumentsmyapp.vsmyappconfigapplicationhost.config"
/site:"myapp" /apppool:"myapp AppPool" -PassThru

With this, my script is executed in the background, but I can’t see the IIS Express process running in my process details(application is not running)

Source: Windows Questions

LEAVE A COMMENT