localhost refused to connect Error in visual studio

I had a similar issue. Try this and it should work

  1. Go to your project folder and open the .vs folder (keep your check hidden item-box checked as this folder may be hidden sometimes)

  2. In the .vs folder open the config folder

  3. See that applicationhost.config file there? Delete that thing. (Do not worry it will regenerate automatically once you recompile the project.)

Leave a Comment