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:37

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 :

  1. Right click on project in solution Explorer -> Properties
  2. Click on to Web (On LHS).
  3. Look at local IIS Web Server (Which would be radio btn selected by default).
  4. Change port no of project Url e.g : http://localhost:1030/ to http://localhost:45896/ (Possibly Higher than 1024)
  5. Save changes and run application.

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.

查看更多
一夜七次
3楼-- · 2019-01-14 05:37

Simply go to taskmanager --> Process --> iisexpress --> right click --> end process tree --> then you can build and run your application

查看更多
The star\"
4楼-- · 2019-01-14 05:37

The issue got resolved by following the below steps: - Project-> Properties-> Web - Under Servers select local IIS. - Save the setting and Browse again

查看更多
The star\"
5楼-- · 2019-01-14 05:37

In my case i tried every post I found on net and nothing works, last thing I done is to change option on project right click/ use visual studio web server and all works well now...

查看更多
我想做一个坏孩纸
6楼-- · 2019-01-14 05:38

One solution is to delete or clear the history in your browser. Then, restart the Visual Studio and re-run your application.

If this solution doesn't work, then it's time for you to change the port number for your development server (IIS Express).

I hope it helps you.

查看更多
再贱就再见
7楼-- · 2019-01-14 05:38

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.

查看更多
登录 后发表回答