Closing one of my running application in multiple startup project

Locked Closing one of my running application in multiple startup project

  • quarta-feira, 22 de fevereiro de 2012 13:55
     
     

    Hello all,

    In my winform solution (using C#), I have two projects. Clicking on the solution (in the solution explorer), I chose "Set startup projects" and selected the multiple startup project. Each project is set as "Start".

    When closing the second project's winform, I want that this project stops running and that the first project goes on runnnig.

    After a while, I want to rerun the second project.

    How could I do this programmatically and without adding buttons to my form? 

    Thanks,

    Bamboula

    • Movido CoolDadTxMVP, Moderator quarta-feira, 22 de fevereiro de 2012 14:54 IDE related (From:Visual C# General)
    •  

Todas as Respostas

  • quarta-feira, 22 de fevereiro de 2012 14:53
    Moderador
     
     Respondido

    Why would you write code programmatically to terminate something running in the debugger when the debugger is normally not going to run?

    In general if you configure VS to start multiple projects then if any terminate then the debugger will shut down.  What you probably want to do is just set your main app as the startup app.  Later if you want to start the other project you can right click it in Solution Explorer and select Debug\Start Instance (or something like that) and you'll then be debugging both.  if the second process terminates then it doesn't stop the debugger IIRC.  So you can restart it as needed.

    Michael Taylor - 2/22/2012
    http://msmvps.com/blogs/p3net

    • Marcado como Resposta Lie YouModerator segunda-feira, 27 de fevereiro de 2012 08:57
    •  
  • quinta-feira, 23 de fevereiro de 2012 19:49
     
     

    Can anyone tell me why there is no link to post a new thread in this forum?

    Can anyone give me the url for posting a new thread to this forum?


    - Eric www.my-msi.net/Admin

  • quinta-feira, 23 de fevereiro de 2012 20:49
    Moderador
     
     Respondido

    It's the big orangish brown button on the top right of the screen after you've logged in.  It's above your profile picture. 

    • Marcado como Resposta Lie YouModerator segunda-feira, 27 de fevereiro de 2012 08:57
    •