Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can we change dotnet core Kestrel port to:80 or :8080

My question is simple. I work on aspnet core web api project. I will publish this project to remote server. When Kestrel is running, default port is 5000 or anythink like this.

I want to change this port to 80 or 8080. Can I do that?

When I try to change from launchSettings, I get this error:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

System.IO.IOException: 'Failed to bind to address http://localhost:80.'

>Solution :

Your problem may be because you already have another web server running on your system (e.g. IIS) that is already binding to port 80.

You can check with this powershell command:

Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess

This command will show you what process is listening on port 80. If nothing is listening, it will return an error.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading