Visual Studio development web server dynamic port numbering problem

The problem 


I had this problem in Visual Studio 2005 and now I have it in Visual Web Developer 2008 express edition where when debugging a web application using the development web server the dynamic port number used by the server didn’t match what Visual Studio had used for the web browser. It was always wrong and normally out by two or three port numbers.


For example the cassini web development server starts and I can see in the notification area what port number it uses


visual studio web server port


However the web browser started by Visual studio looks like this




Clearly that isn’t going to work.


The Solution


I managed to track down the problem to my firewall software part of the ESET Smart Security Suite. Now, I am pretty sure that when I was using Visual Studio 2005 and had the problem that I was using either McAfee, Norton/Symantec or possibly even the Outpost firewall software. My solution won’t work if you aren’t using Eset but hopefully it will help you to look in the right area.



  1. If you are using ESET Smary Security Suite then I bet you are using the Protocol Filtering (you can tell by looking in the Advanced Firewall Setup).
    You could just turn it off and ignore the rest of my blurb but you probably want to keep Protocol Filtering enabled so goto step 2.

  2. In the Advanced setup you need to locate the section shown in the image below and uncheck the web development server.

  3. Make sure you stop the web development server if it’s still running and then try debugging from Visual Studio again.

Feedback


Please let me know if this helps you or if you think the instructions can be improved. Equally if you using a different firewall and found the solution please let me know.

http://www.wahooga.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.wahooga.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.wahooga.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.wahooga.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.wahooga.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.wahooga.com/wp-content/plugins/sociofluid/images/google_48.png http://www.wahooga.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png

Related posts:

  1. Watin and Nunit for testing web pages I recently had to develop some new content for an...

Related posts brought to you by Yet Another Related Posts Plugin.

Tags: ,

51 Responses to “Visual Studio development web server dynamic port numbering problem”

  1. Andrea Says:
    February 25th, 2008 at 11:03 am

    Thanks so much!!!

  2. Julian Says:
    February 26th, 2008 at 6:12 am

    Had the same sort of problem with Viual Studio 2005, Windows XP and ESET. No problem for several months - then suddenly started. ESET update? However, after excluding C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe in the Web browsers selection in ESET things went back to normal.

  3. Kevin Finke Says:
    February 28th, 2008 at 6:53 pm

    I am running NOD32 and VS2008. I’m now getting a message telling me “Unable to launch the ASP.NET development server. Port ‘xxxx’ is in use”.

    If I change ports to dynamic, it appears to work. If I turn off Web Access Protection in NOD32 it appears to work. However, clearing or not clearing the box for webdev.webserver in the dialog above did not seem to help.

    Any ideas?

    Thanks,
    Kevin

  4. Stavros Dimopoulos Says:
    March 5th, 2008 at 8:35 pm

    Hi, I had to manually add the web development server on the web browsers list, and then it worked as you described.

    Many thanks!!!

  5. Stavros Dimopoulos Says:
    March 6th, 2008 at 12:19 am

    Additional solution (may be needed on some people)

    from http://forums.asp.net/t/987980.aspx

    DoubleClick on Nod32 icon on tray and Open it up.
    if it is not in “Advanced Mode” , switch to Advanced Mode. ( you can do it by clicking on the bottom-left link “Display:Standard Mode” and then click on “Toggle Advanced Mode” )
    then goto SETUP section. then on the Right Pane click on “Antivirus and Antispyware protection”. the panel should be opened.
    now in the “Web Access protection” click on “Configure…”
    from the left Tree go to path : “Web access protection > HTTP > Web Browsers”
    now you should see visual studio 8 “devenv.exe” in the list .
    click on it twice till you see a cross sign in the box. ( Note on CROSS sign , not mark sign ! )
    with this cross sign you tell the Nod32 that this program should not be scanned and filtered for web access.

  6. Dave Mellors Says:
    March 6th, 2008 at 7:09 pm

    Glad to hear this is working for people - it certainly had me scratching my head for a while.

    Kevin, I’m not sure I understand from your comments what the problem is. Could you try and clarify and I will try and help.

    Stavros, thanks for the link to the forums and additional instructions.

  7. Arif Octovian Says:
    March 19th, 2008 at 11:04 am

    Thanks, your kindness really save my day ;)

  8. Luis Santamaria Says:
    March 20th, 2008 at 8:20 am

    Hello Dave!

    Thanks a lot for this “tip”. I had the same problem for, like one week, and nobody knew or could say what the problem was. It was until now when I read your article that I realize about the problem’s reason.
    Thank you again!
    -Luis

  9. Dave Mellors Says:
    March 26th, 2008 at 8:41 am

    Thanks for the feedback from everyone. I’ve contacted Eset technical support suggesting they might want to put it on their support section.

  10. Miroslav Majtaz (ESET Tech Support) Says:
    March 26th, 2008 at 4:46 pm

    Thanks. We’ll add that to our KB.

  11. Elrond Says:
    March 28th, 2008 at 7:35 am

    Thanx Stavros! Your solution worked for me.

  12. Gavin Hewins Says:
    April 9th, 2008 at 2:49 pm

    Many thanks for that. This problem only occurred for the first time for me today (after an ESET update).

    I was getting very frustrated by this until I came across your solution.

    Regards

    Gavin

  13. murdoc Says:
    April 21st, 2008 at 7:58 pm

    Thank you very much Dave!

  14. jimbob Says:
    April 23rd, 2008 at 1:04 pm

    worked for me too, thanks (was doing my head in)

  15. Christian Moller Says:
    April 25th, 2008 at 7:49 pm

    Thank you very much Dave it did the trick!!

  16. Eric Says:
    April 28th, 2008 at 7:18 am

    It didn’t work for me. In the active mode list the VS server wasn’t mentioned. I did the other suggestions which didn’t work either. Even disabling Web Access or nod32 completely. So I removed nod32 which did the job for me. I find it bad that a “Virus scanner” does this. Is nod32 becoming the new New Norton?

  17. Dave Mellors Says:
    April 28th, 2008 at 10:22 am

    Eric, thanks for the comment.

    I think it’s good that a virus scanner has this sort of feature but I guess there is an issue in that I think most of us probably didn’t know the feature existed until we came across this problem. Although, it sounds like your problem may be unrelated.

    I think my main problem with Norton/Symantec (and McAfee) was the support wasn’t very good and they rarely seemed to develop the product to address the problems that users experienced. My impression of ESET is quite different so I’m surprised if the ESET technical support team weren’t able to help you - I’d certainly be interested to hear what they had to say and as I get a lot of visitors who use their software I am sure they would be interested in your experience of the support.

  18. Eric Says:
    April 28th, 2008 at 9:38 pm

    Hi Dave,

    I talked to Eset, but they said that this was the solution. But still it didn’t worked for me. I asked myself how many people first talked to Microsoft and how does Microsoft finds it that there development tool is standard blocked by nod32?

  19. Dave Mellors Says:
    April 28th, 2008 at 10:11 pm

    Thanks Eric. Sorry to hear this didn’t fix your problem and that the support hasn’t worked for you.

    You have probably already spent some time trying to sort the problem and I can’t say I could do any better but a fresh pair of eyes sometimes help. If you fancy another go at troubleshooting the problem I’d be happy to try and help (drop me a message with your email address using the contact link on my blog)

  20. Nikola Says:
    May 8th, 2008 at 12:11 am

    Hi Dave, unfortunately this solution did not worked for me. At the beginning I was getting messages like:

    ———————————————————————–

    XML Parsing Error: no element found

    Location: http://localhost:xxxx/xxxxxxxxxxxx/xxxxxxxxx

    Line Number 1, Column 1:

    ^  

    ———————————————————————–

    But then I realized that my problem was not in the XML but it was port number mismatch. So the above solution as i mentioned didn’t worked, do you have any other (anybody)?

    Thanx  

  21. Dave Mellors Says:
    May 8th, 2008 at 6:57 am

    The problem I describe is where the ASP.NET development server reports that it starts on port x but when the browser window is started by Visual Studio it tries port y. If you are getting an XML Parsing Error then it sounds like something is responding to your request although I guess it might be something else other than the web server.

    Have you tried creating a new ASP.NET web site using Visual Studio and seeing if you still get the problem - this would then help to identify if the problem is with your project or not.

    Also, you can see what port your web server is using or what is using the port you think your web server should be on by running a netstat -ab from a command prompt and looking for the port number or [WebDev.WebServer.EXE].

    Let me know how you get on.

  22. Nikola Says:
    May 8th, 2008 at 6:04 pm

    I really think that is more VS2008 (the one that I’m using) and NOD issue,but I am not sure. I will continue with this matter and if I come up with something I will inform you!

    Thanks anyway

  23. Arthur Nemirovsky Says:
    May 27th, 2008 at 4:51 pm

    Thank you very much, This solved my weekend of headaches. I am very glad I found your post. Thanks again.

  24. jobejufranz Says:
    June 6th, 2008 at 7:40 am

    As what others mention here, a million thanks. You save my day.

  25. Nikola Says:
    June 14th, 2008 at 6:45 pm

    Hi David, I solve my problem and now I am sure that NOD made it. So anybody with this kind of “headache”, should reinstall their antivirus software or get another (newer version).

    Thanks anyway

  26. Valliappan Says:
    July 7th, 2008 at 6:16 am

    Nice one!.. will try this out.. had the same problem and searching.. searching and at last.. found my exact issues listed here..

  27. JC Says:
    July 17th, 2008 at 7:47 pm

    Niiiiiiiiice! Got me going in the right direction. Although the web server was unchecked the previous screen was filtering my devenv…one more click on this turned it to a cross and that did the trick!

  28. vp Says:
    July 24th, 2008 at 2:28 pm

    Thank you! I thought that the Vista with VS08 makes me crazy, but it was problem of Eset.. after reading your article I change the setting of Eset and everything works fine… Finallyyy! :)

  29. Greg Says:
    July 31st, 2008 at 5:23 am

    Niice, mine stopped working just after vista sp1 so I thought it was that. All fixed and working Finally

  30. MArtin Falkfält Says:
    August 7th, 2008 at 10:04 am

    Thank you This shit keept me awake for several nights!!

  31. Cobus Says:
    August 15th, 2008 at 2:41 pm

    Thank you for the help, I tried everything to no avail. Stavros Dimopoulos comment logged on March 6, 2008 12:19 AM solved my problem.

    I searched on ESET’s website but did not find any comment to Visual studio in their help. I was disappointed, but that’s live, you have to move on

  32. Michael Says:
    August 18th, 2008 at 8:41 pm

    I trid the Nod32 options but not work, when I remove it it work good

  33. http:// Says:
    August 25th, 2008 at 4:06 pm

    Thanks for the help, same problem here.
    Webserver added to the list then unchecked, and it works fine now

  34. http:// Says:
    September 2nd, 2008 at 12:24 am

    To Eric
    The same thing happened to me. Tried the steps above, but it did not work.

    But I found the solution! When I diabled NOD32 by right-clicking it and choosing “disable antivirus and spyware protection”, and then running Visual Studio, and then enabling NOD32 again, the port numbers were in sync again!

    Regards!

  35. http:// Says:
    September 8th, 2008 at 1:00 pm

    Thanks!! after reinstalling IIS and Visual Studio and everything else, and it still didnt work, I found this, and it helped. Thanks again!

  36. http:// Says:
    September 22nd, 2008 at 7:42 am

    I think the above solution doesn’t work for everyone.. I still can’t solve it though I have followed your above steps! = ))

  37. http:// Says:
    September 24th, 2008 at 4:01 pm

    Damn Eset. I have lost about hour to solve this problem. Thanks for this article!

  38. http:// Says:
    September 26th, 2008 at 9:15 am

    Thanks a lot. I was trying and cant find where the problem occured, even after reinstalling IIS / VS. i was tied for a week and so. I found this link and followed the steps and it worked for me. Great!

  39. http:// Says:
    October 2nd, 2008 at 9:51 am

    Thanks Dave and Stavros! I woulda never figured this out on my own

  40. http:// Says:
    October 4th, 2008 at 2:56 am

    Thanks a lot. I never will figure out the problem was ESET.

  41. yeppie Says:
    October 7th, 2008 at 11:12 pm

    thanks man, it was really starting to get on my nerves…

  42. http:// Says:
    October 11th, 2008 at 5:20 am

    This worked great!!! I’ve been searching for this fix for about 2 weeks (was about to say screw it and reinstall my system). THANKS A TON!

  43. http:// Says:
    October 13th, 2008 at 1:34 pm

    Thankyou so much. I had no idea what was going on and you saved me! Seriously, thankyou so much…..so much

  44. Anatoly Says:
    October 15th, 2008 at 7:34 am

    Stavros Dimopoulos, thank you a lot.

  45. http:// Says:
    October 23rd, 2008 at 2:12 pm

    Thanks so much, this has been bugging me for weeks. Up until today I was just creating a virtual directory in IIS to serve it.

  46. http:// Says:
    October 26th, 2008 at 1:36 am

    Started with the two port numbers desviation but a couple of days ago after any update, simply localhost did not work anymore.
    With this post problem solved!!!

  47. http:// Says:
    October 26th, 2008 at 5:53 pm

    I tried it and it works.
    Thank you for help.

  48. http:// Says:
    October 30th, 2008 at 9:27 am

    Thank You soo much!!!!!!

  49. Niki Says:
    November 12th, 2008 at 1:09 pm

    Thank sooooo much, but by me there was and another problem. I have Vista and Visual Studio 2008. The another problem was solve by changing the file C:\Windows\System32\drivers\etc\hosts. I just replace “::1″ with “:::1″. If the problem still remain try it.

  50. Dave Mellors Says:
    November 12th, 2008 at 10:41 pm

    Thanks Niki, but I haven’t come across :::1 before. What does it do?

  51. kietvt Says:
    November 16th, 2008 at 11:45 am

    great article!
    With this post problem solved!!!

Leave a Reply