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