问题
I tried to run a solution through Visual studio on my local machine. I get the webpage to appear and receive the error on the page: Unable to connect to the remote server No connection could be made because the target machine actively refused it 127.0.0.1:8888
The page that loads is http://localhost:5009/ and when I try localhost:8888 I get "This page can't be displayed"
Thought it might be firewall related so I opened port 8888 but still the issue occurs
someone suggested that this might be an IIS Express issue that Visual Studio 2013 hides but I couldn't find the config for it.
Thanks
回答1:
I had same problem. It was configuration to point to Fiddler. I removed the fiddler configuration in the web.config file and problem solved.
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
回答2:
I know this is old but I would like to share what did to resolve this problem. I found out that the cause of this is from the Internet Explorer's Proxy connection is enabled.
You can go to IE > Settings > Internet Options
Then Internet Options dialog will open.
Go to Connections tab and look for LAN settings.
From there, if you see the "Use a proxy server for your LAN (These settings will not apply to dial-up or VPN connections)." checked, uncheck it and press OK.
then that error will be removed.
I hope this helps on other readers experiencing this kind of issue.
回答3:
I had this problem due to a Fiddler upgrade. I just unticked "Enable IPv6".
回答4:
Also check machine.config under
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config and/or C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config
i had this set by fiddler:
<system.net>
<defaultProxy>
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
remove this xml part. If it does not take effect restart your computer (i needed it in my case).
回答5:
I had this issue when I changed the configured port number for my website. The first run on Firefox or Chrome would work, but the error would appear in the Output window on subsequent runs and the page would never load. It seems the browser holds on to the port number after the debugging stops, so it cannot launch again.
The solution for me was to start running it in Internet Explorer. That is the one browser that consistently opens and closes the port appropriately in tandem with VS2013.
来源:https://stackoverflow.com/questions/35350852/visual-studio-no-connection-could-be-made-because-target-machine-actively-refus