localhost refused to connect Error in visual studi

2019-01-14 10:51发布

I have copied my solution file from another system and tried to run it on my machine: For this, I have gone to the project folder and deleted the previous solution file and copied the new one.

Now, it started giving me error. connection refused etc. So, I got one solution from here: How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?

According to it, I changed the port number from 1049 to 1052. It loaded and one of the pages gets loaded. But when I entered the desired login credentials then it redirected to the older port again, like this:

http://localhost:1049/Home/SearchFlight

and the error is:

 This site can’t be reached

 localhost refused to connect.
 Search Google for localhost 1049 Home Search Flight
 ERR_CONNECTION_REFUSED

Now, I don't know what to do from here. I have changed the port number to 1052 but still its pointing to 1049. What should i do now?

21条回答
劳资没心,怎么记你
2楼-- · 2019-01-14 11:19

rebooting the machine was the only thing that worked for me

查看更多
forever°为你锁心
3楼-- · 2019-01-14 11:21

I was having this issue and solved it by closing all open instances of Visual Studio.

查看更多
可以哭但决不认输i
4楼-- · 2019-01-14 11:21

Unfortunately, none of these answers worked for me. This answer finally did for Chrome only. Unfortunately, you have to do it each time:

  1. Open this in your browser: chrome://net-internals/#hsts
  2. Go to Delete domain security policies
  3. Enter "localhost"
  4. Restart browser

Google Chrome redirecting localhost to https

查看更多
登录 后发表回答