Can we explicitely define port for Kestrel (dotnet.exe) when hosting in IIS as OutOfProcess.

Amit Rawat
546
Reputation points
I use <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> within my .NET Core Project File. Then I publish my code to folder and hosted it on IIS.
When I check Process Explorer search for dotnet.exe. I found it always runs on some random port. I checked Environment variable ASPNETCORE_PORT within process explorer.
My question is, is there any way I can fix this port. I don't want IIS or .NET Core application randomly assign port to my kestrel or dotnet.exe.