Debugging website in a solution with many websites starts many web server instances

Last post 06-13-2009 8:19 AM by Crypth. 7 replies.

Sort Posts:

  • Debugging website in a solution with many websites starts many web server instances

    04-14-2007, 7:45 AM
    • Member
      295 point Member
    • simone_b
    • Member since 12-11-2004, 8:51 AM
    • Italia
    • Posts 69
    I've got a problem about debugging a website in a solution containing other several websites. When I select the website to debug and hit F5 all websites in the solution start debugging, and many instances of the development web server start up for each of them. Anyone has any advice about how to prevent this from happening?
  • Re: Debugging website in a solution with many websites starts many web server instances

    04-14-2007, 7:53 AM
    • Contributor
      2,560 point Contributor
    • Sohnee
    • Member since 02-02-2007, 10:18 PM
    • UK
    • Posts 492

    If you go into the debug configuration manager, you can select the projects to build when you debug (it should be a drop down options with "debug" and "build") - This might help.

     I must admit, I've always used IIS rather than the built in web server to deal with multiple website projects - so this might not be the answer.

  • Re: Debugging website in a solution with many websites starts many web server instances

    04-14-2007, 8:44 AM
    • Member
      295 point Member
    • simone_b
    • Member since 12-11-2004, 8:51 AM
    • Italia
    • Posts 69
    This doesn't seem to be working. When I hit Ctrl + F5 only the selected website creates a new instance of the web server, but when I run in debug mode all websites start with their own server instance, which makes my system go out of memory.
  • Re: Debugging website in a solution with many websites starts many web server instances

    04-15-2007, 10:09 PM

    Hi Simone,

     

    Here is a workaround can avoid multi-instance of “ASP.NET Development Server”to start. The Development Server by default starts for every file system project with different port. So we can set each project to use the same port number. After does that, only one instance of Development Sever will start for the startup project.

     

    To specify a port for the ASP.NET Development Server

    1. In Solution Explorer, click the name of the application.
    2. 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.

    1. In the Properties pane, click the text box beside Port number and type in a port number.
    2. Click outside of the Properties pane. This saves the property settings.

    If you change the startup project, please be sure also stop the Development Server in status notification area. Because it is being used for current project.

     

     

    Sincerely,
    Benson Yu
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
  • Re: Debugging website in a solution with many websites starts many web server instances

    04-15-2007, 10:32 PM
    • Member
      295 point Member
    • simone_b
    • Member since 12-11-2004, 8:51 AM
    • Italia
    • Posts 69
    Thanks for the reply. Well, I thought it was my solution file which was somehow messed up. I wonder why this behavior is by design, I don't see the point of running as many web server instances as there are websites in the solution. It's like all console or winform projects were launched at each debug.
  • Re: Debugging website in a solution with many websites starts many web server instances

    04-18-2007, 4:16 AM
    Answer

    Hi simon,

     

    I understand that you think Visual Studio needn’t start ASP.NET Development Server for non startup projects. I think so, but sometimes this behavior is useful. For example:

     

    Solution with two projects, one is win form, another is web services. Maybe we will invoke a web method in the win form. It will fail unless the ASP.NET Development Server starts automatically.

     

    I fully understand you concern that it will make your system go out of memory. You can take my advice as a workaround or create web site as HTTP to avoid it. I hope this helps.

     

     

    Sincerely,
    Benson Yu
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
  • Re: Debugging website in a solution with many websites starts many web server instances

    03-05-2008, 4:35 PM
    • Member
      64 point Member
    • boatboy
    • Member since 04-12-2006, 8:53 PM
    • Posts 31

    I still don't understand why this is a "by design" feature.  The scenario you describe of a web service and win form is exactly why there is a "Multiple Startup Projects" section.   IMO, if I choose "Single Startup Project" and more than one project starts up, that's a bug.  Can somebody please explain why this is a "by design" feature?

  • Re: Debugging website in a solution with many websites starts many web server instances

    06-13-2009, 8:19 AM
    • Member
      17 point Member
    • Crypth
    • Member since 07-05-2006, 5:48 AM
    • Posts 4

    I'm sorry and no offense, but I find it a bit patronizing that visual studio and you do not believe i know which projects to startup myself or not. In fact, there might be situations where the need is opposite. For instance, you have a window app, and a web server app. You want to make sure your error handling code handles that the webserver isn't online at the moment.

    Yes i know its likely to be the other way around. What i'm saying is we should have the option.

    For the record, i tried the workaround. My dev env. is VS2008 with Visual Source Safe. When the files are checked out, even though i've set a specific port on all webserver projects, it decided to change the port. When i checked in the files, hence the project files are read only, only the first webserver started, and the 3 remainers crashed.

     Just my two cents.Smile

Page 1 of 1 (8 items)
Microsoft Communities