Unable to launch the IIS Express Web server, Failed to register URL, Access is denied

后端 未结 30 2317
刺人心
刺人心 2020-12-07 08:11

Some web projects are causing me problems while others work fine. I decided to focus on one of the problematic ones. I\'m using Visual Studio 2013 on Windows 7. I think I\'m

30条回答
  •  盖世英雄少女心
    2020-12-07 08:34

    I got the same issue when running my application from Visual Studio 2019 on Windows 10. After some time googling and trying various proposed solutions without success, I determined that the "Access Denied" error was a result of the port number my application uses (50403) falling in an "excluded port range".

    You can view the excluded port ranges with the following command:

    netsh interface ipv4 show excludedportrange protocol=tcp
    

    After some more time googling I found that the two most likely culprits that create these exclusion ranges are Docker and Hyper-V. Docker was not installed on my computer but Hyper-V was.

    My Solution

    1. Disable Hyper-V: Control Panel-> Programs and Features-> Turn Windows features on or off. Untick Hyper-V
    2. Restart the computer.
    3. Add the port you are using to the port exclusion range: netsh int ipv4 add excludedportrange protocol=tcp startport=50403 numberofports=1 store=persistent
    4. Reenable Hyper-V
    5. Restart the computer

    I added the port I am using to the exclusion list to ensure that I won't get this problem again after reenabling Hyper-V. After Step 4 and 5 when I viewed the excluded port range I can see that Hyper-V reserved a port range starting with the next port after my port.

    My application now worked perfectly!

提交回复
热议问题