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

Amit 691 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.

Internet Information Services
A set of technologies in the .NET Framework for building web applications and XML web services.
4,306 questions
{count} votes