I attempted to run my web service through visual studio. I faced an issue like :
---------------------------
Microsoft Visual Studio
---------------------------
I tried the following already:
I also tried using this but zero results.
netstat -aon | find ":80"
I also tried using but also return zero results.
netstat -ao | findstr
So what I did is delete this "Microsoft.VsHub.Server.HttpHostx64.exe" then my project successfully started and launch in browser. The error was fixed. I am not sure why but it works.
Here is the screenshot:
Tried everything, was at my wits end.
Then tried closing EVERYTHING that was open with an internet connection on my machine.
Chrome, Steam, Slack, etc... all swiftly given the boot.
Problem solved.
netstat -ano | findstr <your port number>
The port might be excluded, try this command to see if the range is blocked by something else:
netsh interface ipv4 show excludedportrange protocol=tcp
You can try to unblock the range from the start port for a number of ports (need Command Prompt with Administrator):
netsh int ip delete excludedportrange protocol=tcp numberofports=<number of ports> startport=<start port>
For me I couldn't unblock these, I just got "Access is denied", so I ended up having to pick another port for my site.
Having just wasted half a day trying to fix this same issue, I felt I should add the solution which eventually worked for me.
TL;DR If netstat
indicates that the problematic isn't in use, still try a few others in a totally different range
I've run into this problem before but usually find restarting visual studio, changing ports (increment by 1) or rebooting do the trick. However on this occasion none of this helped, and netstat
wasn't finding a conflicting process. I even reinstalled IIS and visual studio and removed several other programs which I suspected could be interfering. It seemed as though IIS was trying to launch multiple instances of the same site.
Eventually I tried running netstat
without findstr
. I visually scanned the list of active ports and noticed that although the ones I had tried were not listed, there were a few processes using ports in a similar range. So instead I looked for a range which was free, picked a port number and that seems to now be working.
I'd love to hear if anybody can explain why this might have worked?
I had the same problem. I just restarted Visual Studio and it worked.
I followed @Zoti's instructions and used Resource Monitor to find the port in question.
Turns out Outlook had randomly been assigned the port for it's communications channel. Moral of the story being, it could be absolutely anything.