This is running on Windows Server 2008 and used to work several months ago. I am just now using this server again for some dev work with VS.
This is live web server used to serve up a few test sites as well.
This came up when running Visual Studio, then launching my projects for debugging.
Trying to launch any site through localhost:xxxx
when IISExpress has been launched (using actual port #'s in the config to access different sites):
This webpage is not available
ERR_CONNECTION_REFUSED
I have been at this for a few days already, as I have read others have had similar issues, tried most things I have read including changing the managedruntimeversion
from "v4.0" to "v4.0.30319" for .net 4.5 (I have never had to do this before) and disabling the logging module (all suggestions found here).
There are only two entries in my hosts
file that point to internal server IP addresses. No localhost
related IP's or references.
I have gone as far as re-installing IIS Express, and Visual Studio 2013. I also created a brand new WebApplication
site to try to resolve this (simple and no other complicated bindings).
When I spin up Fiddler, I see the following on the page:
[Fiddler] The socket connection to localhost failed.
ErrorCode: 10061.
No connection could be made because the target machine actively refused it 127.0.0.1:23162
I have removed all proxy settings from IE's LAN connection section, where before I was getting a red-x popup in VS indicating something like IISExpress could not launch.
This is not a matter of SSL vs non SSL.
I had TFS Server installed - uninstalled that in case there were some odd bindings that were interfering.
I tried deleting the IISExpress config/settings folder several times.
Current applicationhost.config contains:
<site name="WebApplication1" id="4">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\TFS-WorkRepository\Sandbox\WebApplication1\WebApplication1" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:23162:localhost" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
I wish there was a tag for really-stuck
.
Please suggest away, as I don't want to go as far as spinning up a new server.
-- UPDATE --
In the URL bar, when I enter the computer name or IP address :xxxx I get the ERR_CONNECTION_TIMED_OUT
rather than ERR_CONNECTION_REFUSED
.
This question is related to
visual-studio
localhost
iis-express
This issue may be because in the recent past you have used IP address binding in your application configuration.
Steps to Solve the issue:
netsh http show iplisten
If you see some thing like below then this solution may not help you.
IP addresses present in the IP listen to list:
0.0.0.0
If you see something different than 0.0.0.0 then try below steps to fix this.
netsh http delete iplisten ipaddress=11.22.33.44
netsh http add iplisten ipaddress=0.0.0.0
iisreset
And now your issexpress is set to listen to any ping coming to localhost binding.
Thanks for all the answers. I tried all of them but none of them worked for me. What did work was to delete the applicationhost.config from the .vs folder (found in the folder of your project/solution) and create a new virtual directory (Project Properties > Web > Create Virtual Directory). Hope this will help somebody else.
Make sure you have a start page specified, as well. Right click on the .aspx page you want to use as your start page and choose "Set as start page"
I was simply trying to Bind IP with IIS but ended up messing with IIS config files I literally tried 20+ solutions for this, which includes
but what worked which may work for someone else as well was to REPAIR
IIS from
Control Panel\Programs\Programs and Features
Else you can refer to this answer as well
This may be relevant to a certain subset of people with this issue...perhaps in a different flavor.
I was forcing an https redirect on RELEASE.
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
#if !DEBUG
filters.Add(new RequireHttpsAttribute());
#endif
}
And there wasn't https enabled on my iis express. Working correctly on DEBUG
I solved this problem by starting Visual Studio with Run as administrator
. This is also required if you want to publish your project to the local IIS.
To set this permanently:-
Properties
Advanced
Run as administrator
is checked-onOK
all the way out.If you are using "real" IIS, this can occur if the W3SVC (World Wide Web Publishing) service is stopped.
Should seem obvious but if you accidentally stopped the service or have it set to manual this could happen to you.
I know the title says IIS express however google doesn't seem to filter out the express even when using a -Express hint so hopefully this helps someone else who found this page instead of an IIS-specific one.
In my case it was caused by starting IIS with no administrative rights. When I launched IIS as admin and started the site it worked fine
I've just fixed this for my machine. Maybe it will work for some. Maybe not for others, but here is what worked for me.
In IIS, I had to add bindings for https to the default website (or, I suppose, the website you are running the app under).
Now my localhost works when debugging from Visual Studio.
I tried a lot of methods on Chrome but the only thing that worked for me was "Clear browsing data"
Had to do the "advanced" version because standard didn't work. I suspect it was "Content Settings" that was doing it.
Sam's solution worked for me, but I didn't want to run as admin as a permanent solution.
This is how I solved it in my case:
After that I could run my app without the need for admin rights. But it did messed with the ability to browse to my app from an external computer. Close enough for me for now.
I had the same problem. I tried these steps:
Another try:
Another try:
WHAT IT WORKED:
A simple work around(it worked for me) is use the IP address instead of localhost. This should be fine for your development tasks.
In my case, my co-worker changed the solution name so that after I get latest version of the project, I run my web application with IIS EXPRESS, then I got the message ERR_CONNECTION_REFUSED
in my google chrome.
After I try all the solution that I find on the internet, finally I solved the problem with these steps :
Run As Administrator VS
Open Debug > [Your Application] Properties > Web
Change the port in Project URL and don't forget using https
because in my case, when I'm using http
it still did not work.
Click Create virtual directory
Run the application again using IIS EXPRESS.
And the web application ran successfully.
Hope these helps.
In my case, it was caused by an infinite loop/stack overflow.
Rebuild All worked for me. VS2013, IIS Express.
I recently encounter this issue when I copy the source code from another machine.
-> Delete the .vs folder (it is hidden folder, so make sure you have enable view hidden folder option)
-> open visual studio and build your project. Visual studio will create new .vs folder as per current system configuration
While probably not related to your problem, I had the same issue today. As it turns out, I had enabled an URL Rewrite module to force my site to use HTTPS instead of HTTP and on my production environment, this worked just fine. But on my development system, where it runs as an application within my default site, it failed...
As it turns out, my default site had no binding for HTTPS so the rewrite module would send me from HTTP to HTTPS, yet nothing was listening to the HTTPS port...
There's a chance that you have this issue for a similar reason. This error seems to occur if there's no proper binding for the site you're trying to access...
Source: Stackoverflow.com