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 ?
Another option is to delete the
applicationhost.config
as well from your local solution folder.Visual Studio stores this as well in a folder called
.vs\config
in the root of your solution folder.Delete or edit the
applicationhost.config
there helped me resolve thisTry closing Visual Studio and open it again using the "Run as Administrator" option.
From the MSDN library
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
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.
I have also experienced this error when running Fiddler at the same time as Visual Studio. Quitting Fiddler and re-running the application did the trick for me.
Much more likely than any of the above answers: delete IISExpress folder, as described in this SO article.