Getting ERR_CONNECTION_REFUSED when running .NET API on localhost from Visual Studio

I’m a newbie in .NET coding, I’m trying to run a project using .NET using IIS Express on Google chrome, I get this error : ERR_CONNECTION_REFUSED

enter image description here

Here is what I’ve tried so far, and it does not work:

  • Changing the port number under properties section, and creating a new virtual directory enter image description here

  • Removing the applicationhost.config from the .vs project folder

  • Disabling the proxy

  • Running Visual Studio as an Administrator

  • Disabling the Script Debugging

Add Comment
3 Answer(s)

While creating the database connection try to use port number with localhost it worked for me so might go same with you as well…. Good luck.

Add Comment

Please try to visit your HTTPS address, some websites may disable HTTP connection, such as Asp.Net Core Application.
enter image description here
Besides, try to repair the IIS Express in the console panel.
enter image description here
Feel free to let me know if the problem still exists.

Answered on July 16, 2020.
Add Comment

In my case, this issue was resolved by removing the .vs file followed by restarting Visual Studio as an Administrator

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.