Wednesday, August 12, 2009

Multiple instances of Visual Studio Development server getting created

Sometimes while developing some of you might notice a lot instances of Visual Studio Development Server (aka Cassini) in your system tray… Many of these icons when clicked on land up just vanishing away and at times these icons may flood the system tray causing frustration…  Sorry for that :-(

One of the reasons for this happening is that ASP.NET Development server is set up to use dynamic port allocation as shown below:

WAP (Right Click Project –> Properties –> Web)

Auto-assign Port

Web Sites (Select Web Sites –> F4 to see properties)

image

Sometimes on some developer boxes either Windows firewall or custom firewall blocks a bunch of ports… In this situation Web Development Server tries to hook to one of the blocked ports port and is not allowed to… In the process the Development Server lands up crashing… Next time it tries to assign itself to another dynamic port and the same thing happens…  As a result there are various tray icons created even though the Web Development Server exe has actually crashed…  That is the reason when you hover over the icons in the system tray they vanish away…

Firstly, let me call out that this is a bug, I just verified it with our key dev Bill Hiebert and he confirmed that this is now fixed in VS 2010…  For the time being the work around for VS 2008 developers is to go ahead and turn off the Auto-assign Port/Use Dynamic ports option and actually set a fixed port which you know is not blocked by one of your firewalls…  Hopefully with this the multiple icons in the system tray should no longer appear…

If you still face problem then do write back…

-Vishal

6 comments:

Justin Wignall said...

-- "Firstly, let me call out that this is a bug, I just verified it with our key dev Bill Hiebert and he confirmed that this is now fixed in VS 2010…"

Nope, still happening :)

Vishal R Joshi said...

Justin, if possible can you send me an email at Vishal.Joshi@Microsoft.com I would love to follow up with you...

Patrick said...

This is happening for me with Visual Studio 2008 on Windows 7 Enterprise even with a static port number selected.

PHP Development Company said...

Good information about visual studio development.

Derive said...

This is still happening to me with VS2012.

Anonymous said...

Still happens in VS2012 Update 4
Dont know about VS 2013

temporary workaround:
http://stackoverflow.com/questions/5637523/why-so-many-instances-of-asp-net-development-server

Tl;DR;

■ Select the web project
Open the "Properties" window by pressing F4
■ Change the Always Start When Debugging value to False
■ Repeat steps 1-3 for any other web projects in your solution