[visual-studio-2010] Localhost not working in chrome and firefox

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

http://localhost:49824/

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

The answer is


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.

enter image description here


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.

enter image description here


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:

  1. Go to LAN Settings: Options->Advanced->Network. In the "Connection" section of the "Network" tab press "Settings" button to open "Connection Settings" dialog box.
  2. Select "Manual proxy configuration:" radio button
  3. The "No proxy for:" textbox should contain the following text: "localhost, 127.0.0.1"

For all browsers,

  • Open internet Options (or Internet properties)
  • Go to connections tab
  • Click on LAN Settings
  • Tick Use proxy server for your LAN
  • Tick Bypass proxy server for your local address (Don't change the port number)
  • Click on 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

  1. Search IIS In Visual Studio 2015 Search IIS image

  2. Chose (Use the 64 bit of version of IIS Express for web site and project Use 64 bit image )


You need to disable Script Debugging In Visual Studio


Examples related to visual-studio-2010

variable is not declared it may be inaccessible due to its protection level SSIS Excel Connection Manager failed to Connect to the Source This project references NuGet package(s) that are missing on this computer Gridview get Checkbox.Checked value error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj What is the difference between Visual Studio Express 2013 for Windows and Visual Studio Express 2013 for Windows Desktop? Attach (open) mdf file database with SQL Server Management Studio What is and how to fix System.TypeInitializationException error? Could not load file or assembly "Oracle.DataAccess" or one of its dependencies IIS error, Unable to start debugging on the webserver

Examples related to asp.net-mvc-3

Better solution without exluding fields from Binding IIs Error: Application Codebehind=“Global.asax.cs” Inherits=“nadeem.MvcApplication” Can we pass model as a parameter in RedirectToAction? return error message with actionResult Why is this error, 'Sequence contains no elements', happening? Failed to load resource: the server responded with a status of 500 (Internal Server Error) in Bind function 500.19 - Internal Server Error - The requested page cannot be accessed because the related configuration data for the page is invalid String MinLength and MaxLength validation don't work (asp.net mvc) How to set the value of a hidden field from a controller in mvc How to set a CheckBox by default Checked in ASP.Net MVC

Examples related to razor

Uncaught SyntaxError: Invalid or unexpected token How to pass a value to razor variable from javascript variable? error CS0103: The name ' ' does not exist in the current context how to set radio button checked in edit mode in MVC razor view @Html.DropDownListFor how to set default value Razor MVC Populating Javascript array with Model Array How to add "required" attribute to mvc razor viewmodel text input editor How to correctly use Html.ActionLink with ASP.NET MVC 4 Areas Multiple radio button groups in MVC 4 Razor How to hide a div element depending on Model value? MVC

Examples related to localhost

Xampp localhost/dashboard Set cookies for cross origin requests Invalid Host Header when ngrok tries to connect to React dev server How to turn on/off MySQL strict mode in localhost (xampp)? What is IPV6 for localhost and 0.0.0.0? How do I kill the process currently using a port on localhost in Windows? How to run html file on localhost? Can't access 127.0.0.1 Server http:/localhost:8080 requires a user name and a password. The server says: XDB How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?