I've had this working on the same Windows box in Win8 Win8.1 and Win10. Yesterday I performed the Threshold 2 upgrade to Windows 10 and now I can't launch my API in IISExpress.
The bindings are setup like this:
<binding protocol="http" bindingInformation="*:51258:jamhq" />
<binding protocol="http" bindingInformation="*:51258:192.168.0.8" />
I've triple checked all my netsh settings and at the moment Windows Firewall is completely disabled whilst I troubleshoot.
Every time I try to launch this I'm now presented with an error like this:
Failed to register URL "http://192.168.0.8:51258/" for site "<name>" application "/"
Error Description: The Network location cannot be reached.
For more information ... (0x800704d0)
I can ping this IP (obviously since I'm pinging myself), I can ping this location from my other machines / devices.
It seems like some extremely low level network setting has been changed.
Has anyone seen this problem or have a solution?
So, this is something that might help others in the future, I've been going round and round on this problem today and have just fixed the issue.
It appears that the update removes IP addresses that the http.sys is listening on. So when executing:
netsh http show iplisten
The only entry I had after the update was:
::
So executing:
netsh http add iplisten 192.168.0.8
Bingo, everything is now working again.
Related
I know that this question has been asked in multiple forums and have several versions of the answers.. Unfortunately, none of those answers helped me out to resolve my issue.
I stood up an AWS EC2 instance of Windows Server 2016 and installed IIS, MSMQ, Windows Process Activation Service and few other things.. When I cracked open my IIS Manager, I noticed that the "Default Web Site" is stopped and when I tried to start it I get an error "The process cannot access the file because it is being used by another process (Exception from HRESULT:0x80070020)". Tried to dig a little more and found these two exceptions in my Event Viewer:
Unable to bind to the underlying transport for [::]:80. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine. The data field contains the error number.
The World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://:80/SmsHandler for site 1. The site has been disabled. The data field contains the error number.*
Researching more online I found more than 2 dozen articles on this issue and more than 95% of them saying that the potential application that might be conflicting with IIS and using port 80 and 443 could be Skype.. But I DON'T HAVE SKYPE installed on my server..
I ran the "netstat -aon" command and found this:
C:\Windows\system32>netstat -aon | findstr :80
TCP 169.254.170.2:80 0.0.0.0:0 LISTENING 1164
Going by what's mentioned in other articles online.. I tried to trace down the PID - 1164 in my Task Manager and found that its the "Service Host - Local System" process having 15 System services running into it.. There's no way I can kill that process to make my IIS work..
I then tried to change the Bindings in my IIS to listen on a different port than 80 and was able to get it up and running.. But I don't want IIS to run on any other port than 80 since I don't want the user to specify the port in the URL every time when they hit the website..
I'm now running short of ideas here.. Any suggestions would be greatly appreciated.
Thanks!
I ran into a similar issue, but not with port 80. In my case it was because the ip address [::] wasn't allowed to listen on any port. Adding it to the ListenOnly list in the registry fixed the issue.
From an admin command prompt:
netsh http add iplisten ipaddress=::
From this thread.
Found the culprit.. It apparently wasn't skype for me (as it is in most of the cases), it was this service called IP Helper which was running on port 80 and was conflicting with IIS. The way I found that out was, I checked all the services running under the PID for Service Host - Local System (which in my case as 1164) and started stopping them one at a time and saw if IIS starts working.. Just wanted to close this thread.. Hope this helps if someone else get stuck with the same issue.
I had VMware Workstation installed, the solution is: "VMware -> Edit -> Preferences -> Shared VMs -> "Disable Sharing".
I'm used to using a Mac, and ngrok is a breeze; all you need to do is specify a port, but I'm new to IISExpress, and I can't figure out how to use ngrok and/or IIS correctly. To be clear, I've inherited a Windows machine from a coworker (who has left the company) and the set up works great locally.
The local url is similar to:
thing.somedomain.com
In the bindings section of IIS, I've got:
Type Host Name Port IP Address
http thing.somedomain.com 80 *
I've used this page for reference: https://www.twilio.com/blog/2014/03/configure-windows-for-local-webhook-testing-using-ngrok.html
The instructions seem reasonable, but they don't work for me. These instructions indicate that the file applicationhost.config needs to be altered for IIS. I have found this file, and found the correct section for the site I need to ngrok. The binding info does not match what's in the IIS gui though:
<binding protocol="http" bindingInformation="*:4085:localhost" />
As per the instructions, I have added:
<binding protocol="http" bindingInformation="*:4085:whatever.ngrok.io" />
(Here every time I run ngrok on windows I get ngrok.io instead of ngrok.com, which seems odd. I've tried accessing both ways with no luck.)
I have restarted the site on IIS (in the actions menu). When I try to access the ngrok url from a remote machine, ngrok returns 502 bad gateway, and the remote machine shows:
Failed to complete tunnel connection
The connection to http://whatever.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:4085.
Make sure that a web service is running on localhost:4085 and that it is a valid address.
The error encountered was: dial tcp 127.0.0.1:4085: ConnectEx tcp: No connection could be made because the target machine actively refused it.
When I try to go to localhost:4085 locally, I get "This webpage is not available". When I try to go to localhost:80, I get a redirect to a different site the IIS is serving. When I try 127.0.0.1:80, I get a 404 error.
I have tried using netstat -a -b, and have tried all of the ports associated with 127.0.0.1, and nothing turns up the correct site (yet still thing.somedomain.com still works correctly).
I'm completely mystified, and don't know what to try next, or where the problem lies (in how I'm starting ngrok, in how I'm accessing ngrok, in how the bindings are mapped, in how IIS restarts, a firewall issue, or some other voodoo). This should be bloody simple!
So it turns out that there was nothing to change in the ApplicationHost.config file, AND I was looking at the wrong ApplicationHost.config file (the real file is normally hidden from view in C:/Windows/System32/inetsrv/Config, but you can open it in Notepad from a Command Prompt that has elevated privileges (Run as Administrator)). The actual binding info was:
<binding protocol="http" bindingInformation="*:80:thing.somedomain.com" />
Which is what matched what IIS was showing. That said, what I needed to change was how I invoked ngrok:
ngrok http -host-header=thing.somedomain.com:80
And that was it. I also allowed external traffic to the hostname with this:
netsh http add urlacl url=http://thing.somedomain.com/ user=everyone
There is a way to make it easier. Let's say your IISExpress website is http://localhost:63254
Just start ngrok like this:
ngrok http --host-header=rewrite localhost:63254
I am using VS2012 with IIS Express and can not seem to browse my web sites using my IP Address. Is there some way to do that? It used to work fine with earlier versions of VS.
For example, this address works fine:
http://localhost:64651/
But, this address does not work.
http://192.168.252.165:64651/
I am sure of the IP Address, since I just got it using ipconfig.
Go to your IISExpress>Config folder, locate applicationhost.config. Change <bindings> as below:
<bindings>
<binding protocol="http" bindingInformation="*:1407:YOUR_IP_ADDRESS" />
</bindings>
Before you do this , you will have to register this IP address using netsh command as below:
Port forwarding in Windows 7
If you’re running Windows 7, pretty much all incoming connections are locked down, so you need to specifically allow incoming connections to your application. First, start an administrative command prompt. Second, run these commands, replacing 192.168.1.11:1234 with whatever IP and port you are using:
> netsh http add urlacl url=http://192.168.1.11:1234/ user=everyone
This just tells http.sys that it’s ok to talk to this url.
IMPORTANT: The user=everyone parameter must be specified according to the system language. So if your windows language is spanish the parameter must be user=todos.
> netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=1234 profile=private remoteip=localsubnet action=allow
This adds a rule in the Windows Firewall, allowing incoming connections to port 58938 for computers on your local subnet.More information at this link.
Port forwarding Mac OS X
Step 1: View Current Firewall Rules
sudo ipfw show
Step 2: Add Port Forwarding Rule (80 to 8080)
The default port that Tomcat runs on is 8080, so here we show the command to do port fowarding from port 80 to 8080 (Tomcat’s default port). Obviously, this works for other ports as well, and you’d just have to adjust the command accordingly.
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
This is a temporary change, and it will revert once you reboot. If you want to make it permanent, you can create a lauch deamon for it.
Optional Remove Rule
If you want to remove your firewall rules run:
sudo ipfw flush
Port Forwarding Using PFCTL (aka PF) on Mac OS X
The setup for pfctl is similar to ipfw. Github user kujon has created a nice guide to show how to set up port forwarding from port 80 to another port using pfctl.
Note: Be sure to change the bindings of your project only by locating its name. You can even keep the localhost binding and add a new one , this way you can access same webpage using both the given IP address and your old localhost binding.
You can use Conveyor by Keyoti
Step 1:
Download the Visual Studio Extension by searching for 'Conveyor' in the Tools->Extensions and Updates dialog.
Step 2:
Conveyor is automatically enabled for web application projects, run (debug) a project and note the Remote URL, that is the URL you will use from your device or other computer. Please see troubleshooting below if you don't see the Conveyor window.
Step 3:
Add an inbound firewall rule allowing access to the TCP port given in the Remote URL.
1. Open Windows 'Start' and type WF.msc.
2. Click 'Inbound Rules' on the left.
3. Click 'New Rules' on the right.
4. Choose 'Port' in the new dialog, then 'Next'.
5. Select TCP, and enter the port from the Remote URL next to 'Specific local ports' (probably 45455), then 'Next'.
6. Next, and next (you may want to disable 'Public'), give it a name like 'Conveyor: web dev server access enabled'.
Step 4:
Use the Remote URL from your device (phone, tablet or other machine) to directly access your application.
More information at Conveyor
binding visual studio in local iis ip webconfig
From what I understand, VS2012 comes with the IIS Express version by default. And it allows you to connect to the development site using IP address. Currently I can connect using http://localhost:22222. But this would not connect using this http://xxx.xxx.xxx.xxx:22222 where xxx just a local IP of the development machine . I have verified that the IIS Express is running and being used. The IE error was http 400 bad request.
I know you have asked question since a long time. I have an answer to this question at this link.
Go to your IISExpress>Config folder, locate applicationhost.config. Change <bindings> as below:
<bindings>
<binding protocol="http" bindingInformation="*:1407:YOUR_IP_ADDRESS" />
</bindings>
Before you do this , you will have to register this IP address using netsh command as below:
If you’re running Windows 7, pretty much all incoming connections are locked down, so you need to specifically allow incoming connections to your application. First, start an administrative command prompt. Second, run these commands, replacing 192.168.1.11:1234 with whatever IP and port you are using:
> netsh http add urlacl url=http://192.168.1.11:1234/ user=everyone
This just tells http.sys that it’s ok to talk to this url.
> netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=1234 profile=private remoteip=localsubnet action=allow
This adds a rule in the Windows Firewall, allowing incoming connections to port 58938 for computers on your local subnet.More information at this link.
Note: Be sure to change the bindings of your project only by locationg its name. You can even keep the localhost binding and add a new one , this way you can access same webpage using the given IP address.
The solution that worked for me was this one:
The one thing that fixed this for me was using the following line in the <bindings> section for my site in the applicationhost.config file:
<bindings>
<binding protocol="http" bindingInformation="*:8099:" />
</bindings>
The key was to simply remove localhost. Don't replace it with an asterisk, don't replace it with an IP or a computer name. Just leave it blank after the colon.
After doing this, I don't need to run Visual Studio as administrator, and I can freely change the Project Url in the project properties to the local IP or computer name. I then set up port forwarding and it was accessible to the Internet.
EDIT:
I've discovered one more quirk that is important to getting IIS Express to properly serve external requests.
If you are running Visual Studio/IIS Express as an administrator, you must not add a reservation to HTTP.SYS using the "netsh http add urlacl ..." command. Doing so will cause an HTTP 503 Service Unavailable error. Delete any reservations you've made in the URLACL to fix this.
If you are not running Visual Studio/IIS Express as an administrator, you must add a reservation to the URLACL.
Where is it located? applicationhost.config :)
Here
%userprofile%\Documents\IISExpress\config folder
or
%userprofile%\My Documents\IISExpress\config folder
I have been uploading to Azure for at least six months. From this afternoon onwards I now get messages like this:
There was no endpoint listening at https://management.core.windows.net/xxxxxx/services/hostedservices that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8888
Can anyone give me advice on what's wrong. I tried to upload a new management certificate. That worked fine but then said "authentication error".
I have the same problem. It doesn't matter if the Fiddler is ON/OFF or the computer has been restarted - the problem is in Fiddler Option.
The msg was: "Unable to connect to the remote server No connection could be made because the target machine actively refused it 127.0.0.1:8888"
Go=> Fiddler/Tools/Fiddler Option/
Connection Tab:
make sure that "Allow remote computers to connect" is NOT checked
make sure that "Monitor all connections" is NOT checked
Here is a sample video:
http://screencast.com/t/S8y9NbpveSjd
Hope this helps.
Can you please check if Fiddler is running or not? Normally when you run Fiddler it acts as a proxy and listens at port 8888.
Hope this helps.
I have the similar issue. When I use Visual Studio 2013 to download an extension. It can not connect the remote site.
Assi.NET's method doesn't work. Which means unchecked "Allow remote computers to connect" and "Monitor all connections" still can't get rid of the problem.
To fix it, I find in the machine config file, I added something to enable default proxy. Make sure you DISABLE it.
The correct code is:
<system.net>
<defaultProxy
enabled = "false"
useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>