views:

8031

answers:

13

I don't know what has got into my computer today. I was developing just fine in VS 2008 and testing my ASP.NET web site on my development server.

Then suddenly, out of the blue, I can't run my web site any more! As soon as I hit F5, the message appears: Unable to launch the ASP.NET Development server because port '1900' is in use. And it doesn't matter what port I change to, it's always in use! AAARRRGGGHH!!!

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...

Thanks in advance...


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

A: 

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.

Nick Berardi
The OP indicates that he's already tried rebooting, which would mean that this isn't the case of some process that terminated unexpectedly.
Cerebrus
+3  A: 

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

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

olle
Thanks, I tried netstat, and there's nothing running on port 1900.
Shaul
BTW, after I rebooted, IIS does start...
Shaul
netstat -a -b also would show you the executable and ports.
Saif Khan
A: 

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

Chris Ballance
The question states this didn't work.
olle
+1  A: 

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.

hacker
Nice trick! But no good:Connecting To localhost...Could not open connection to the host, on port 1900: Connect failed
Shaul
This result means something else is not listening on port 1900.
Chris Ballance
+1  A: 

This problem was solved by the answer to this question.

Shaul
A: 

Hello.

I am also facing with this problem. I configured my web project to be hosted by IIS and it worked. After that, I set it back to use WebDev and checked "Auto Asign Port". And it still doesn't work, showing the same message "Unable to launch the ASP.NET Development server because port ‘2706’ is in use." - despite the fact that it's not set to use a specific port.

In the same solution I have another web application project and that one works fine. I tried cleaning up the solution, deleted all *.csproj.user, *.suo files, rebooted, and no luck.

This web application project is hosting a WCF service, and the other web app project is hosting a Silverlight application that has a service reference to this web project(wcf).

Any ideas?

Thank you, Cosmin

See the related link in my answer to my own question, that will give you the solution.
Shaul
Thanks a lot, It worked!
A: 

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. Existed Aptana and everything works.

Hal
A: 

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.
Elad
A: 

There must be some other bug causing this issue too. I don't have anything using the port and it still complains it can't launch Cassini.

It's not the "port minus three" issue someone else was reporting, either. Nothing's using the port, Cassini does start (on the wrong port or the right one), it just errors.

Still not found a solution for this. Anyone got any other ideas?

Owen Blacker
I recommend you start your own question - nobody is going to answer you on this thread.
Shaul
A: 

Hi,

Is any body got ride of this issue. I first time encounter issue and replace the wWebDev.WebServer.exe and it run. Again Re-boot stop working and same appear again. I just made replace but nothing happen.

Will any body let me know. Where is the issue.

Thanks, -Ajit

ajit
A: 

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

Iain Fraser
A: 

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...

denizemektup