Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to launch IIS Express Web server

Tags:

asp.net

iis

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?

like image 528
user2657943 Avatar asked Aug 03 '17 09:08

user2657943


People also ask

Why IIS Express is not working?

This issue was a point in time issue that occurred when upgrading between the RCs of Visual Studio 2017 that caused IIS Express to get uninstalled. The issue has since been fixed and you upgrading Visual Studio will solve the problem.

How do I open IIS Express in Visual Studio 2015?

1) In Solution Explorer, right click the your project and click Properties. 2) In the left tab, click Web. 3) Select IIS Express, check out your Project Url, then create Virtual Directory.


3 Answers

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

like image 101
Heki Avatar answered Oct 30 '22 09:10

Heki


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.
like image 33
Fabio Fernandes Avatar answered Oct 30 '22 09:10

Fabio Fernandes


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

like image 20
An Lê Avatar answered Oct 30 '22 09:10

An Lê