Unable to launch the ASP.NET Development server because port '1900' is in use

守給你的承諾、 提交于 2019-11-27 02:06:01

问题


I was developing just fine in VS 2008 and testing my ASP.NET web site on my development server when suddenly I was unable to run my web site anymore. As soon as I hit F5, the message appears:

Unable to launch the ASP.NET Development server because port '1900' is in use.

It doesn't matter what port I change to, it's always in use. I have tried:

  • Changing the port number
  • Restarting Visual Studio
  • Rebooting my machine
  • Installing IIS

Clue: My IIS refuses to start. But I didn't have IIS installed when I was happily working earlier, so that is probably not the issue; it might just be highlighting something else.


Update: after rebooting, IIS does start, but the problem here persists.


回答1:


Simply end all Webdev.WebServer.exe processes - did the trick for me. Occasionally this 'unable to launch because port is in use' error happens when one of the visual studio processes (webdev.webserver.exe) is still running and locked. The webdev.webserver process(s) should end when you close your browser or app but if they dont (for instance my Visual Studio crashed but if left the webserver still running) then this could lock the port and this will prevent visual studio from launching your project. When you try to F5 your app (launch your application from visual studio) then it conflicts with the current port in use and the above 'because port XYZ is in use' error is displayed.

So to fix it: in the status bar (next to your windows clock) right-click and 'Stop' all the ASP.net development server icons. You can also open task manager and kill all the webdev.webserver.exe processes.




回答2:


You can check what software is running on given port by running netstat -o from the command prompt. It will give the Process ID (PID) of the process. I've had this happen after installing Skype, that was bound to port 80 before IIS could.

You can also check the eventlog for messages why IIS won't start. It might give enough information to solve the problem or to google it.




回答3:


The problem was solved for me configuring NOD32 firewall to no longer see VS like a browser.

Setup>Antivirus & AntiSpy>Internet protection>HTTP

Just uncheck the vs, and the issue will be resolved.

I hope this finally helps.




回答4:


Right click on the little "server page" running in your task bar, and click close. This usually happens when the DEBUG process terminates unexpectedly, or visual studio crashes. Try a really high port like 50000 and see if it works. There shouldn't be any processes using that port.




回答5:


I had the same problem for a long time. I checked all the ideas written here. Eventually the only thing that worked for me was:

  1. Unload the project by right clicking it.
  2. Opening the .csproj file by right click the unloaded projoect
  3. Reloading the project (without any change)

Sometimes it solves the problem...

However, I also have a workaround:

  1. Open your Visual Studio 2008 Command Prompt (Start-> Microsoft Visual Studio 2008 -> Visual Studio Tools -> Command Prompt).
  2. Type : webdev.webserver.exe /port:[your_port] /path:"[your_path]"
    your_port is the desired port for the server, your_path is the path where VS stores your source file. Note that you need to paste only the directory where your .asmx file is.
  3. This should run the server manually and listen on the specified port.



回答6:


I found a solution that doesn't require rebooting (for Windows 7).

Next to the clock, there's a tray of icons that is accessible if you click on the triangle icon that is next to the flag. Look for an icon with tooltip "ASP.net development server - port ###". Right click and select "stop"!




回答7:


One thing I have tried in the past when this type of thing happened is telneting to the port and doing a GET or HEAD:

telnet localhost 1900

Then type in HEAD and press enter. Sometimes the data returned shows something like a server name or an application name.




回答8:


Just check there are two instance of vs2008 running in the sidebar.. :)




回答9:


For a webforms site:

  1. Remove the project from the solution.
  2. Edit %userprofile%\Documents\IISExpress\config\applicationhost.config and remove the section for the problem port.
  3. Add the project back to the solution.



回答10:


Set Cassini (Visual studio's lightweight built in web server) to use a different port. You can do this in the project's configuration dialogs




回答11:


I had this same problem today and found a solution so I thought I would add my two cents:

My particular problem was that I would get the "Port in use" error message even though the development server was clearly running and I was able to use the application on it. As it transpired, I was working on a Web Service at the time and happened to have the design view open - without realising. It was this web service's design view that was trying to launch the development server - which is why I couldn't type a single character of code without getting the error.

Close your Web Service's design view... problem solved.

I sincerely hope this helps someone else someday too.

Cheers

Iain




回答12:


I had same problem, "unable to launch asp.net development server" The reason is virus program... I had disable it the it works properly...

I hope this helps...




回答13:


Just a heads up - I came across this error for Port 8000 and it turns out that I still had Aptana Studio running - which apparently runs a java server on port 8000. Exited Aptana and everything works.




回答14:


I had the same issue. The problem was that I also had IIS configured to use those ports. Stopping IIS or changing the ports used in the solution was may solution.




回答15:


I simply stopped service MsDepSvc - Web Deployment Agent Service. Then I was able to run the site.




回答16:


changing the port in Visual studio (Web) Project Properties for IIS express section solved the same problem for me




回答17:


In the website portion of the project, right click and do "Properties Window" NOT "Property Pages" Change "Use Dynamic Ports" to TRUE. You can keep 80 there if it's the port listed--the key is to Use Dynamic Ports.




回答18:


Just re-start the system , Problem would be resolved.



来源:https://stackoverflow.com/questions/500957/unable-to-launch-the-asp-net-development-server-because-port-1900-is-in-use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!