26

Related to a previous issue that I thought was resolved and actually isn't...

My Visual Studio 2008 installation may be a bit messed up, I think.

  1. When my ASP.NET project is set up to use VS Dev Server with a fixed port, I get the "Port in use" error described in the linked question.
  2. When my project is set up to use a random (auto-assigned) port number, it works, but it launches the browser using a port number 3 less than the actual Dev Server port number (e.g. if the port number is 1903, the browser launches to http://localhost:1900/)
  3. If I make changes to the project settings, they do not "take" until I save and restart Visual Studio.

Any ideas how to track this one down?

Thanks!

Community
  • 1
  • 1
Shaul Behr
  • 36,951
  • 69
  • 249
  • 387

7 Answers7

61

I had a similar problem which hit my 2 main machines at the same time. On investigating I found it to be related to the Eset personal security (guessing a recent update messed something up). To solve it I excluded VS2008 from the active browser filtering - this is in: setup -> advanced firewall setup -> antivirus & anti spyware -> web access protection -> HTTP -> webbrowsers

Deselecting vsdev in here fixed the problem - interestingly enough disabling the firewall and antivirus / antispyware did not solve the issue, so it is worth looking for a similar setting if you are running different security software

Macros
  • 7,099
  • 2
  • 39
  • 61
  • Aha! I also have Eset! We may be on the trail! – Shaul Behr Mar 18 '09 at 07:19
  • 1
    Indeed, it was Eset, and your instructions were spot on! Congratulations, you got the bounty! – Shaul Behr Mar 18 '09 at 07:28
  • Thank you :) solved that strange problem from the first look too :) – 0x49D1 Mar 19 '09 at 08:06
  • It also worked for me, thanks, almost one day lost because of this issue – Jhonny D. Cano -Leftware- Mar 25 '09 at 13:38
  • Macros - please visit http://stackoverflow.com/questions/500957/unable-to-launch-the-asp-net-development-server-because-port-1900-is-in-use/650187#650187 and leave an answer there to claim credit for solving that one too. – Shaul Behr Mar 25 '09 at 17:21
  • 8
    Yet another firewall / security product causes more time lost and damage than the very thing they are there to protect. ;) – NotMe Jul 22 '09 at 19:34
  • 7
    Dear GOD this is why I love StackOverflow. This was my problem exactly. THANK YOU! – Ducain Apr 08 '10 at 17:04
  • 1
    @ChrisLively: i dont think it causes damage in this regard, it is these loop holes that hackers exploit to get into your system I think the point is that this should have been properly documented and the enabling/disabling of apps in eset should be more reachable, thanks – shabby Dec 28 '11 at 03:32
  • i should say that some firewall programs also can cause this problem – Arash Sep 30 '12 at 14:30
17

First try to kill all "WebDev.WebServer.exe" processes.

  • In Solution Explorer, click the name of the application.
  • In the Properties pane, click the down-arrow beside Use dynamic ports and select False from the dropdown list.This will enable editing of the Port number property.
  • In the Properties pane, click the text box beside Port number and type in a port number.
  • Click outside of the Properties pane. This saves the property settings.

Hope this helps

alexl
  • 6,841
  • 3
  • 24
  • 29
4

I do absolutely agree with Macros' answer. Just want to share solution for Eset Nod32 v5

In ESET NOD32 v5 to allow Visual Studio to run Development or IIS Express server you must uncheck Visual Studio in Nod32 Advanced Setup => Web and Email => Protocol filtering => Web and email clients

Cheburek
  • 2,103
  • 21
  • 32
2

Weird!

The port number is stored in the .sln file. So, I'd blow that away the solution file first, re-create it and see what happens. If that doesn't help, I'd then move onto the web.config file and blow that away and start again too.

BenB
  • 10,300
  • 7
  • 32
  • 30
1

I also encountered the same error message:

Unable to launch Visual Studio development server because port [xxxx] is in use.

However, I do not have ESET installed. Instead, I had recently installed GlassFish server on my machine and that was causing the problem. Therefore, in Windows Task Manager, I killed the process it runs under which is java.exe and it fixed the problem.

Ray
  • 187,153
  • 97
  • 222
  • 204
1

This also applies to Visual Studio 2010.

And there is more to it.

Symptoms:

  • A Web (Services) project is configured to run at a specific port, e.g. 10080.
  • After a while Visual Studio compains “Unable to launch the Visual Studio Development Server because port ’10080′ is in use
  • The reason is still unclear. It might have something to do with the webdev server crashing.
  • Restarting the pc doesn't solve the problem.
  • Netstat doen’t show an entry for the port 10080
  • Manually startin WebDev.WebServer40.exe at port 10080 works fine.

Since I'd like to start from within Visual Studio, I moved to port 10081, then to 10082, and today to 10083. I’m running out of ports.

Solutions that did not work:

  • Restart Visual Studio
  • Tweaking Trendmicro security settings (couldn't access them)
  • Disabling Forticlient antivirus/firewall

Workaround that DOES work:


  • Configuring my project to manually start the server
  • Right click the project, choose properties
  • Click the tab "Web"
  • Pick for start action "Start external program" and point it to Webdev.Webserver40.EXE (for me: C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\WebDev.WebServer40.EXE)
  • Command line arguments: /port:10080 /path:C:\Solution\Project
  • Working directory: C:\Solution\Project
  • Under servers check "Use Custom Web Server"
  • Do not check any debugger checkbox

Side effect: my project thinks break points are not getting hit. ("no symbols loaded"). Turns out they work like they should.

I hope anybody ever finds a definitive solution, but up until then this workaround does the trick for me.

realbart
  • 3,497
  • 1
  • 25
  • 37
0

To solve your problem, just restart your PC. I've had the same problem, I did the same thing.

Pindatjuh
  • 10,550
  • 1
  • 41
  • 68
billstep
  • 89
  • 4
  • That most likely wouldn't solve the original problem of port numbers not lining up and not changing correctly. If a restart fixed something similar for you it was probably just multiple development server (Casini) instances running without shutting down correctly. – Jon Adams May 11 '11 at 15:59