Visual Studio development web server dynamic port numbering problem
Posted by Dave Mellors | Filed under Software Development
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
![]()
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.
- 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. - In the Advanced setup you need to locate the section shown in the image below and uncheck the web development server.

- 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.
Tags: ASP.NET, Visual Studio
February 25th, 2008 at 11:03 am
Thanks so much!!!
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.
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
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!!!
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.
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.
March 19th, 2008 at 11:04 am
Thanks, your kindness really save my day
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
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.
March 26th, 2008 at 4:46 pm
Thanks. We’ll add that to our KB.
March 28th, 2008 at 7:35 am
Thanx Stavros! Your solution worked for me.
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
April 21st, 2008 at 7:58 pm
Thank you very much Dave!
April 23rd, 2008 at 1:04 pm
worked for me too, thanks (was doing my head in)
April 25th, 2008 at 7:49 pm
Thank you very much Dave it did the trick!!
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?
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.
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?
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)
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
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.
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
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.
June 6th, 2008 at 7:40 am
As what others mention here, a million thanks. You save my day.
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
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..
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!
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!
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
August 7th, 2008 at 10:04 am
Thank you This shit keept me awake for several nights!!
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
August 18th, 2008 at 8:41 pm
I trid the Nod32 options but not work, when I remove it it work good
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
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!
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!
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! = ))
September 24th, 2008 at 4:01 pm
Damn Eset. I have lost about hour to solve this problem. Thanks for this article!
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!
October 2nd, 2008 at 9:51 am
Thanks Dave and Stavros! I woulda never figured this out on my own
October 4th, 2008 at 2:56 am
Thanks a lot. I never will figure out the problem was ESET.
October 7th, 2008 at 11:12 pm
thanks man, it was really starting to get on my nerves…
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!
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
October 15th, 2008 at 7:34 am
Stavros Dimopoulos, thank you a lot.
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.
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!!!
October 26th, 2008 at 5:53 pm
I tried it and it works.
Thank you for help.
October 30th, 2008 at 9:27 am
Thank You soo much!!!!!!
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.
November 12th, 2008 at 10:41 pm
Thanks Niki, but I haven’t come across :::1 before. What does it do?
November 16th, 2008 at 11:45 am
great article!
With this post problem solved!!!
December 14th, 2008 at 8:52 am
I have tried ALL the above and stuff from other sites, did not work. And I know it must be NOD32, because if I redcross IE, then it works (even though i thought it is a bad idea to redcross IE, lol)
But the solution from Niki work!!! WTF is the extra :: doing?
Thanx anyway Niki!
December 21st, 2008 at 9:23 am
The double colon :: in IPv6 addresses compresses zeroes. So, FF02:0:0:0:0:0:0:2 can be shortened to FF02::2 but I haven’t managed to find any reference to a triple colon.
I believe ::1 is the IPv6 equivalent of localhost (127.0.0.1) and I wonder if :::1 is actually invalid and therefore the effect is that IPv6 localhost is being removed from the hosts file. To prove this it would be very helpful if somebody who finds that using :::1 works for them could try commenting the line out instead (like # ::1) and see if it has the same effect .
January 4th, 2009 at 7:43 am
Thx, Stavros Dimopoulos
your solution saved me those modifying of ports everytime i ran my application for debugging…
January 6th, 2009 at 7:04 pm
Thank you for posting this. I was afraid that the issue was with IIS 7, which I know absolutely nothing about!
I did not see the web developer program in the items when I opened ESET, but I went into the web browsers node (just above the active mode node) and unchecked VS 2K8 and now I am able to debug once again. I never thought I would be so happy to see a screen full of errors when debugging. But after two hours of “page cannot be displayed” this is a welcome change.
January 8th, 2009 at 2:15 pm
[...] Post original: Visual Studio development web server dynamic port numbering problem [...]
January 25th, 2009 at 3:53 pm
I too had this problem. But in my case web development server was not in the list of web browsers or under active mode. So there was no check box to un-check. So I had to enable protocol filtering for only HTTP and POP not applications, which made me going with the development server.
January 29th, 2009 at 4:46 am
Big help. Thank you so much!
February 8th, 2009 at 1:36 am
I’m using Visual Web Developer 2008 Express Edition and have ESET NOD32 Antivirus 3.0.642.0. I didn’t have devenv.exe in my list of Internet Browsers in ESET Advanced Setup, but I did have VWDExpress.exe. I put marked this entry with a red X but it did not help. I was still receiving the “Internet Explorer can not open this web page error”. I finally edited my “c:\windows\system32\drivers\etc\hosts file. It did not have a “::1″ line, but I added a line with “#::1″ and that did the trick. Thank you to all that helped with this solution.
February 13th, 2009 at 9:38 pm
How can I find out a port has been used by another application in my system? Thanks!
February 21st, 2009 at 12:37 am
Spot on – excellent find! This should be on the MSDN trouble shooter AND the ESET site and make sure both are in the google cache.
I wish I had found this 2 hours ago!
Thanks David!
March 13th, 2009 at 3:21 pm
Thanks a lot, I just fixed it
March 16th, 2009 at 10:05 am
wow, it works for me too, thanks mate.
currently using VS 2005
March 17th, 2009 at 8:24 am
Thank you very much boss…. It helped me a lot. Although i disabled the Eset Firewall but that too ddn’t help until i found this particular article. You saved my time.
March 26th, 2009 at 2:38 pm
HELP!~~
I can’t found :C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.Webserv……
thanks。my English is dosen’t well (⊙o⊙)
March 31st, 2009 at 5:22 pm
aw, It doesn’t work for me. Even though I disable web access protection fully and disable firewall protection. Am I missing something?
May 19th, 2009 at 4:03 pm
Didn’t work
None of them. I have found my solution after hours of searching on internet. I had to manualy edit SLN file project.sln and save it.
Instead of
VWDPort = “2869″
VWDDynamicPort = “true”
i had to write for example
VWDPort = “3000″
VWDDynamicPort = “false”
and save this file. If i edit the same values in Visual Studio, it did not work. Only manual edit of the file worked. Interesting, I do not get it. VS2005, WinXP SP2, Eset Smart Security.
July 25th, 2009 at 11:31 am
Here is solution:
“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 ! )”
And the most important: RESTART THE MODEM.
well done
-T
September 28th, 2009 at 3:57 am
This solution is not work for me
i cant even have the devserver folder in my pc?
Anyone have other solution than this?
i’m using vs 2005
October 6th, 2009 at 11:44 am
thanks!great post!
March 2nd, 2010 at 2:42 pm
I tried to disable the ESET but i still get the same problem of the ports
any advice ?? !!
May 13th, 2010 at 3:48 am
Hi thanks a lot. tried one of the above suggestion.
selected the Antivirus, Protocol filtering, “HTTP and POP3 ports”.
Solved the problem.
Then reselecting back the default protocol filtering option does not bring back the issue. Seems like something stuck in eset filtering. Just need to flush it ???
January 19th, 2011 at 4:55 pm
I am very thankful to this topic because it really gives useful information ;.’