Starting an Aspnet core site on IISExpress

One cannot point at a folder and just start, as we did with the full framework. There seems to be several solutions for Core and the one described here requires a publish. (Visual studio 2017:menu->Build->Publish)

Publishing a dotnet core site copies relevant parts to a folder

"path\iisexpress.exe" /path:"path\site\bin\Debug\netcoreapp2.2\publish" /port:betweenmagicalnumbers

Here is the exact command I recently used.

"C:\Program Files\IIS Express\iisexpress.exe" /path:"C:\DATA\PROJEKT\Lagardsdorren\Lagardsdorren\bin\Debug\netcoreapp2.2\publish" /port:44342

The port number is limited to 44300 to 44399 to avoid having to start Visual studio with elevated privileges. Reference.

Do not walk the path with “..” as you get an “Invalid physical path.” error.

Set an environment variable to give better debug output. Reference.

$Env:ASPNETCORE_ENVIRONMENT = "Development"

Tags: ,

Leave a Reply