Reputation: 1859
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?
Upvotes: 37
Views: 181356
Reputation: 27
Most of these replies were not working for me after running into the same issue in late 2024 on a Macbook.
For me, the solution ended up being to open System Settings > Privacy and Security. Then scroll to find Local Network. Make sure it is enabled for Google Chrome or whatever browser you hit issues with.
Upvotes: 0
Reputation: 11
None of the solutions mentioned above worked for me. So if you have changed port number in httpd.conf
and httpd-ssl.conf
, you need to change port in xampp config, too.
You can do that by:
Upvotes: 0
Reputation: 1859
Finally I found the solution ... It's very easy
Go to the LAN settings (In Chrome : Tools -> Options -> Under the hood -> Change Proxy setting -> LAN Setting)
There will be a checkbox for "Bypass proxy server for local address"
Tick the checkbox.
Done!
On Mac/Apple: Chrome uses system preferences for localhost exclusion:
Go to System Preferences -> Network -> advanced -> Proxy settings
Add 'localhost' at the bottom where it says: 'ignore proxy settings for these hosts and domains' (Exceptions are separated by a comma)
Upvotes: 75
Reputation: 93
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.
Upvotes: 0
Reputation: 1
Steps
Search IIS In Visual Studio 2015
Chose (Use the 64 bit of version of IIS Express for web site and project )
Upvotes: -1
Reputation: 25029
For my project, I am set up to use https
. I just got a new computer and cloned the project in git. The protocol and port number for the project are not saved in the solution file, so you have to make sure to set it again.
Upvotes: 0
Reputation: 5576
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.
Upvotes: 1
Reputation: 201
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
Upvotes: 6
Reputation: 13727
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.
Upvotes: 1
Reputation: 533
For Firefox:
Upvotes: 0
Reputation: 141
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
Upvotes: 9
Reputation: 41822
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. :)
Upvotes: 17
Reputation: 91
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 )
Upvotes: 9