I have asp.net web application project in visual studio 2012. When I want to start it, I have the following error:
Unable to launch the IIS Express Web server: Port"4012" is in use
This problem came from nothing.How can I resolve it ?
I have asp.net web application project in visual studio 2012. When I want to start it, I have the following error:
Unable to launch the IIS Express Web server: Port"4012" is in use
This problem came from nothing.How can I resolve it ?
From the MSDN library
Visual Studio cannot guarantee that the port you specify will be available when you run your file-system Web site. If the port is in use when you run a page, Visual Studio displays an error message.
To change the port used by IIS Express to run your program you should follow the procedure outlined by this article on MSDN
How to: Specify a Port for the Development Server
In short, we need to edit the file %systemdrive%:\Users\<username>\Documents\IISExpress\config
and change the binding information found in this file and change other configurations for the IIS Express.
As a consequence of this not so simple way to fix the problem, I recommend to close the application that tries to use that port access on you dev computer. Look for specific tools like TCPView from Microsoft that could help to spot the application that grabbed your port. Often it is only the browser
I was having similar problem in visual studio 2012:
ERROR: " Unable to launch IIS Express web server.
Failed to register URL http://localhost:1030/ for site "MySite" application "/". Error Description: The process cannot use file because it is being used by another process. (0x85968574) "
REASON : Actually this port numbers are dynamically generated at runtime. It dosent guranteed to be available. If it is acquires by some other process project wont run. So we need to try at another port.
SOLUTION : There are various solution i found on internet but problem remains unsolved. Finally I tried following solution :
This makes changes in IIS config files and wherever needed automatically so we don't need to change any code explicitly. That's work for me hope will work for You too.
Killing the IIS Express Worker Process solves this for me; I run into this while trying to debug two concurrent instances of Visual Studio 2015 and switching between the two web solutions.
If this is a constant problem then Kedar's answer of modifying the solution is better, but in a pinch, for a code review, etc I prefer this.
If this situation is sudden (everything works ok, but suddenly the error Unable to launch the IIS Express Web server is shown) the solution that often works for me is simply:
Works like a charm :) If doesn't, try different solutions from this thread.
PS. I post it as an answer so it can be found easily, although someone wrote it here somewhere in a comment.
Remove your extra bindings from the config file.
run command prompt as an administrator and type.
1 . netsh http show urlacl
you will see a list of url that has been used, make sure the one you are trying to use currently is listed in this. in the next step you have to delete this reservation.
2 . netsh http delete urlacl url=/Your complete URL as listed in the list above/
after the acknowledgement, restart IIS
In my case I had to do two things:
a. Remove the virtual directory from this file:
C:\Users\<user-name>\Documents\IISExpress\config\applicationhost.config
b. run the program TCPView from: http://technet.microsoft.com/en-us/sysinternals/bb897437 Find the process which is using your port, and "End Process".
After this, in Visual Studio, open the web app project properties, select Web tab, click "Create Virtual Directory" button to re-create the virtual directory. Run the web app in debug mode.
Much more likely than any of the above answers: delete IISExpress folder, as described in this SO article.