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

Amit 731 Reputation points
2022-11-08T07:29:43.063+00:00

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
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,400 questions
{count} votes