“Unable to launch the IIS Express Web server.” in Visual Studio

前端 未结 27 1471
清酒与你
清酒与你 2021-01-30 00:44

I attempted to run my web service through visual studio. I faced an issue like :

---------------------------
Microsoft Visual Studio
---------------------------
         


        
相关标签:
27条回答
  • 2021-01-30 01:05

    I tried the following already:

    • Restarted Visual Studio
    • Check all available ports that might be listening to my specific number but it always return zero results. No processes is listening in my port.
    • 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:

    0 讨论(0)
  • 2021-01-30 01:05

    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.

    0 讨论(0)
  • 2021-01-30 01:06

    If netstat doesn't show anything already using the port

    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.

    0 讨论(0)
  • 2021-01-30 01:06

    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 netstatindicates 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?

    0 讨论(0)
  • 2021-01-30 01:07

    I had the same problem. I just restarted Visual Studio and it worked.

    0 讨论(0)
  • 2021-01-30 01:07

    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.

    0 讨论(0)
提交回复
热议问题