I am doing a web project using visual studio 2010(MVC3 Razor) and Windows 7.
My default browser is IE. When I run the project, the website working is perfectly with the url
When I copy the same url and try to run the website in Chrome or Firefox it shows me the following error.
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: http://localhost:49824/
Connection to 127.0.0.1 failed.
The system returned: (111) Connection refused
The remote host or network may be down. Please try the request again.
Your cache administrator is webmaster.
I have rebuilt the solution and added the url to allowed site. But still the problem persists. How should I solve this problem?
This question is related to
visual-studio-2010
asp.net-mvc-3
razor
localhost
Changing my LAN network settings to not automatically detect a proxy server worked for me BUT resetting your Windows network stack may help.
See The Nuclear Option: Resetting The Crap Out Of Your Network Adapters in Vista from Scott Hanselman.
I found that when I had this issue that I had to delete the application.config
file from my solution. I was pulling the code from co-worker's repository whose config
file was mapping to their local computer resources (and not my own). In addition to that, I had to create a new virtual directory as explained in the previous answers.
For Chrome go to
Settings->Network->Change Proxy setting
Now Internet properties will open so you need to go LAN settings and click on check box :
Bypass proxy server for local address
In case the browser LAN proxy setting solution doesn't work for you:
As mentioned in this similar Q&A How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?
Simply changing the port number of your web project can be a quick fix.
I faced the same issue and the complete solution is to set to false(uncheck) the "Automatically detect settings" checkbox from Lan Area Network( the same window as for Bypass proxy server for local address )
For Firefox:
For all browsers,
internet Options
(or Internet properties) connections
tabLAN Settings
Use proxy server for your LAN
Bypass proxy server for your local address
(Don't change the port number)Ok
Now you are good to go. :)
If you are using windows system:
please check the file
C:\Windows\System32\drivers\etc\hosts
and add line such as:
127.0.0.1 localhost
Steps
Search IIS In Visual Studio 2015
Chose (Use the 64 bit of version of IIS Express for web site and project )
You need to disable Script Debugging In Visual Studio
Source: Stackoverflow.com