Monday, June 30, 2008

Multiple Visual Studio Development Server / ASP.NET Development Server

Have you upgraded to Visual studio 2008?
If so, you might have meet the following problem:

  • You have a solution with more than one ASP.NET Web Application project.
  • At least one of those web projects is configured to Use Visual Studio Development Server.

Now, you try to debug one of those web projects. Only one.

you do this by one of those two options:

  • right click the project --> click debug --> start new instance
  • If your web application already runs (usually on IIS settings) --> attach to process.

Now comes the surprise:

Instead of getting one Developer Server icon on the taskbar, you get multiple instances!
(one for each web project configured to work with the Development server)

Now, this is not necessarily a bad behavior, as it doesn't actually start all your web projects (which might finish with a lot CPU and Memory load). It is just open a port for those applications. The first time you request a page is the first time the application loaded.

However - it is not the behavior most of us want.


The Solution:

I guess Microsoft's developers couldn't hide this setting in a better place...

  1. Stand on the web project (on the solution explorer)
  2. From the menu bar --> View --> Properties Window
  3. on the "Always start when debugging" change the value to False.


If you work in a team with source control you'll probably want this setting checked in for all users to get them... but it won't work, as this setting kept on the local .csproj.user file.

It's funny (or it would be if it wasn't sad) that also it is kept in the .user file, it still will ask you to check out the file.

To get over this check out problem, you'll need to uncheck the "Apply server settings to all users (store in project file)" setting on the web tab, in the project properties page, and check in the project.

Hope it will help someone...


Anonymous said...

Thanks, I've been looking for a fix to this for some time.

Anonymous said...

Thanks a lot..This is what i was looking for..

Ilya said...

Thanks man! Great explanation of what it really does (about the ports)

Anonymous said...

Thanks. I was wondering why I had two Web Server icons going!

Who would have thought that the project properties would be different than the context menu "Property Pages"?

Amir Sasson said...

Thanks man we had a solution with 14 services and it was a disaster

Anonymous said...

Thanks a lot man!!!

as the ones before stated... it really helped!

Yaniv L said...


Swappy said...

Thanks Man , This is a relief.

Also , Assigning a port to solution , rather than keeping dynamic assigned ports , help .

Paul said...

Thnx, upgraded from 2005 to VS 10 and had 9 of these icons :)

Richard Byrdk said...
This comment has been removed by the author.
Aladdin Compton said...

There are Internet Information Service and Visual studio development server, use any one of these with file based application projects.