Unable To Launch Web Server

2019-01-14 05:08发布

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 ?

21条回答
甜甜的少女心
2楼-- · 2019-01-14 05:29

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 this

查看更多
贼婆χ
3楼-- · 2019-01-14 05:31

Try closing Visual Studio and open it again using the "Run as Administrator" option.

查看更多
叼着烟拽天下
4楼-- · 2019-01-14 05:33

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

查看更多
老娘就宠你
5楼-- · 2019-01-14 05:34

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.

IIS Express Worker Process

查看更多
Rolldiameter
6楼-- · 2019-01-14 05:34

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.

查看更多
爱情/是我丢掉的垃圾
7楼-- · 2019-01-14 05:34

Much more likely than any of the above answers: delete IISExpress folder, as described in this SO article.

查看更多
登录 后发表回答