Unable to launch IIS Express Web server

5

Everytime I try to debug my asp.net website I get this error:

Unable to launch the IIS Express Web server.

Failed to register URL "http://localhost:50010/" for site "SociopackWebAPI" application "/". Error description: The process cannot access the file because it is being used by another process. (0x80070020)

In eventviewer I noticed this error in the log:

The worker process for app pool 'Clr4IntegratedAppPool', PID='13248', failed to initialize the http.sys communication when asked to start processing http requests and therefore will be considered ill by W3SVC and terminated. The data field contains the error number.

I assume this means my Clr4IntegratedAppPool does not have enough rights? How can I fix thi?

asp.net
iis
asked on Stack Overflow Aug 3, 2017 by user2657943

7 Answers

5

One reason for the IIS Express being unable to start properly can be that the port it wants to use is reserved. The port you want to use will not show up in netstat -an | findstr <your port number> if it is not in use.

You can either change the port you use or remove the reservation.

View reservations (elevated command prompt): netsh int ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
        80          80
       443         443
     50000       50059     *

* - Administered port exclusions.

You can remove the reserved range if it is not in use with netsh int ipv4 delete excludedportrange protocol=tcp startport=50000 numberofports=60. Should reply Ok. If you get Access denied. it is because the range is currently in use. You will have to shut down the program that use the ports in order to create a reservation that intersects with the range.

If you want to create the range again, use netsh int ipv4 add excludedportrange protocol=tcp startport=50000 numberofports=60.

I had this problem because I recently installed Hyper-V and Docker and my IIS Express threw error events in my event log with ID 2269:

The worker process for app pool 'Clr4IntegratedAppPool', PID='12345', failed to initialize the http.sys communication when asked to start processing http requests and therefore will be considered ill by W3SVC and terminated. The data field contains the error number.

And subsequently 2276:

The worker process failed to initialize correctly and therefore could not be started. The data is the error.

Source of my solution: Docker for Windows – Port Reservations | Developer Musings

answered on Stack Overflow Feb 9, 2021 by Heki
2

I had exactly the same problem with VS2017 / IIS Express 10. Tried a few tips & tricks found at forums, but the only one that really fixed the bug definitively is the following:

  1. Close all Visual Studio instances and IIS Express (if it's running)
  2. Go to Windows' "Programs and Resources", find IIS Express in the list of installed programs, and "Uninstall" it
  3. Restart your computer, just be sure that all processes are closed
  4. Download IIS Express 10 standalone installer from Microsoft: https://www.microsoft.com/en-us/download/details.aspx?id=48264
  5. Install it, open Visual Studio, and it should work fine.
answered on Stack Overflow Aug 12, 2017 by Fabio Fernandes • edited May 2, 2018 by Stephen Kennedy
1

If you cannot find your solution for this, try this:

  1. Enter Windows + R & type Regedit
  2. Go to the following path:

    Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
    
  3. Change the value of name Start from 4 to 3.

    Change Start from 4 to 3

answered on Stack Overflow Apr 7, 2019 by An Lê • edited May 21, 2020 by KyleMit
0

"The process cannot access the file because it is being used by another process" usually means that there is something else already listening on that port. Maybe you started the same application twice?

answered on Stack Overflow May 2, 2018 by Erik A. Brandstadmoen • edited May 2, 2018 by Stephen Kennedy
0

Ensure the service Application Host Helper Service (AppHostSvc) is running. Also ensure that Host Network Service (hns) is running.

Some ASP.NET websites might also require ASP.NET State Service (aspnet_state) to be running.

answered on Stack Overflow Oct 16, 2020 by Jared Beach • edited Jan 14, 2021 by Jared Beach
0

This worked for me:

  1. Restore bypass traverse checking rights (see ref)

I only did #2 because the privileges I had were correct already.

  1. Restart the W3SVC and HTTP services To restart the W3SVC and HTTP services by using the net command:

Open an elevated Command Prompt window. Click Start, point to All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator. Type:

net stop w3svc
net stop http
net start w3svc
net start http

Ref: https://social.technet.microsoft.com/wiki/contents/articles/21750.event-id-2269-iis-worker-process-availability.aspx

answered on Stack Overflow Dec 8, 2020 by Marcus
0

This happened for me when I opened an old solution with VS2019. None of the answers here worked for me. So I chose a different approach.

I created a new ASP.NET solution and saw which port is it using. it was using 61384.

Then I closed my solution and opened the .sln file and change the port.

After reloading the solution, it worked.

enter image description here

answered on Stack Overflow Jan 15, 2021 by FLICKER

User contributions licensed under CC BY-SA 3.0