Localhost refused to connect

Steve Ellwood
1 min readMar 21, 2023

--

Having been away from work for a few days, I returned to find my legacy ASP.NET MVC application presenting me with this error despite being unchanged during my absence.

Sometimes when I get this error the following fix works. Go to the main project properties and on the Web page click Create Virtual Directory

Unfortunately that didn’t work for me this time.

When you google this error you get a vast number of results. Fortunately for me one of my top results was from StackOverflow. This page has a number of suggestions. Some of them suggest deleting the .vs folder which Is something I wanted to avoid however having perused the other options, the first one I tried worked for me. In brief this consisted of opening the following in chrome

chrome://net-internals/#hsts

and deleting the domain security policies for localhost. If you are using Edge then the page is at

edge://net-internals/#hsts

It is suggested that you will have to do this each time but that hasn’t happened to me though I haven’t rebooted yet.

--

--

Steve Ellwood
Steve Ellwood

Written by Steve Ellwood

Senior Integrations Officer at Doncaster Council Any views expressed are entirely my own.

No responses yet