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

21

32

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.

Dapper answered 1/2, 2009 at 15:2 Comment(2)
Anything relevant in your event log?Daric
if your application has a solution file, open with notepad you can manually set the port number and remove the ambiguity!!Artur
I
45

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.

enter image description here

Ignacia answered 11/9, 2012 at 12:30 Comment(0)
S
10

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.

Scamp answered 1/2, 2009 at 15:15 Comment(2)
Thanks, I tried netstat, and there's nothing running on port 1900.Dapper
Yup, launching Skype after launching the site fixed this. Up-voting :)Langlois
S
5

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.

Smart answered 5/7, 2011 at 12:27 Comment(0)
C
5

In VS 2019, right click on project properties select Debug, scroll down to web server settings, change port number in AppURL enter image description here

Cornela answered 7/3, 2020 at 19:1 Comment(1)
simple and explanatory solution :PKreisler
G
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.

Grano answered 1/2, 2009 at 15:13 Comment(1)
The OP indicates that he's already tried rebooting, which would mean that this isn't the case of some process that terminated unexpectedly.Heptad
S
4

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.
Selfcontained answered 7/10, 2009 at 16:33 Comment(2)
awesome, your first trick worked for me .. unload-edit-reload. thanksSpindling
I had the same problem. I unloaded all the projects that I didn't need to run the website and the error disappeared. When I reloaded a Windows Application project, the error returned. Bottom line: the Windows Application was the default StartUp project; changing the StartUp project to any of the other projects resolved the issue for me. WeirdSoutherner
H
2

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"!

Hunyadi answered 20/5, 2012 at 0:21 Comment(0)
K
1

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.

Klaus answered 1/2, 2009 at 15:57 Comment(2)
Nice trick! But no good: Connecting To localhost...Could not open connection to the host, on port 1900: Connect failedDapper
This result means something else is not listening on port 1900.Daric
M
1

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.
Militate answered 3/7, 2016 at 19:38 Comment(0)
W
1

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

Will answered 14/8, 2019 at 10:20 Comment(2)
If by 're-start the system' you mean shut down visual studio and then start it again then this worked for me using Visual Studio 2019.Endometrium
this did it for me, I had another instance of the same site open that I was previously debugging (different branch). Closing VS for that instance solved the problem.Protract
D
0

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

Daric answered 1/2, 2009 at 15:20 Comment(0)
T
0

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.

Truitt answered 18/6, 2009 at 19:2 Comment(0)
S
0

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

Subalpine answered 24/3, 2010 at 0:58 Comment(0)
O
0

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

Omega answered 22/7, 2010 at 12:7 Comment(0)
D
0

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

Dews answered 9/11, 2010 at 11:57 Comment(0)
S
0

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.

Scleritis answered 2/2, 2012 at 21:11 Comment(0)
A
0

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

Antoine answered 2/2, 2015 at 10:43 Comment(0)
E
0

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

Visual studio Project Properties for IIS express port in use problem

Eudora answered 14/6, 2015 at 7:15 Comment(0)
Q
0

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.

Quixotism answered 3/7, 2017 at 17:53 Comment(0)
D
0

I faced same issue. But this is working for me when I deleted all window temp files. keyboard typing : 1 - window key + r(open run window) then type "temp" in run window and then delete all files.
2 - type "%temp%" in window run and delete all files.

Above steps resolve by issue.

Ducharme answered 16/12, 2021 at 9:22 Comment(0)
M
0

my problem (54790 is in use) solved by following the steps below:

1-Start IIS Manager. One quick way to do this is by opening the Run command, then typing inetmgr and clicking the OK button.

2-In the Connections pane on the left side of the window, navigate to the Server and Site you wish to check its binding .

3-Open bindings.In the Actions pane on the right, click Bindings…

4-delete the port which is in used .

enter image description here

Md answered 19/11, 2022 at 17:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.