none
close project and open another in Multi-Project Solutions RRS feed

  • Question

  • Hi,

    I am developing a Multi-Project solution (A, B) in Visual Studio 2008.
    I need to run a second project from the start up one and then the first project should be closed.
    The matter is that I want to Exit the A.exe and kill the process and the dll that are depending on it. And then Run the B.exe.

    Thank you for your help.


    Wednesday, April 11, 2012 9:53 AM

Answers

  • Somewhere you miss in my idea the correct meaning of the word project and solution in Visual Studio.

    A project is a development part which can be build stand alone. A collections of projects is a solution. 

    From selected projects in a solutions you can make assemblies which exist from one project or multi projects.

    Assemblies are DLL's or Exe files.

    Building the assemblies under command of the configuration manager

    Have a look  on this page where using links is explained how you can use it.

    http://msdn.microsoft.com/en-us/library/t1hy4dhz(v=vs.100).aspx


    Success
    Cor


    Wednesday, April 11, 2012 10:37 AM

All replies

  • Somewhere you miss in my idea the correct meaning of the word project and solution in Visual Studio.

    A project is a development part which can be build stand alone. A collections of projects is a solution. 

    From selected projects in a solutions you can make assemblies which exist from one project or multi projects.

    Assemblies are DLL's or Exe files.

    Building the assemblies under command of the configuration manager

    Have a look  on this page where using links is explained how you can use it.

    http://msdn.microsoft.com/en-us/library/t1hy4dhz(v=vs.100).aspx


    Success
    Cor


    Wednesday, April 11, 2012 10:37 AM
  • To clarify, you have a solution with a DLL and an EXE. You want to close the EXE project and have a different EXE instead? (I'm not sure this is right, though).

    Regardless, you can add as many projects as you like to a solution, but there can be only ONE startup project. Add both EXE projects, and set the one you want as the startup project (you can right click and 'Set as StartUp Project').

    You may need to clarify exactly, and precisely, what you mean.


    Stephen J Whiteley

    Wednesday, April 11, 2012 2:07 PM
    Moderator
  • Cor's right. You must distinguish between development and runtime. During development, there are projects whereas during runtime, there are running processes.

    You can do what you describe by calling Process.Start

    To quit the calling process (A) there are different ways. It depends on the project settings. A process exits automatically when all threads have quitted. I assume you do not start additional threads, so you just have to make the current thread quit. If the application framework is enabled (see project properties), the condition set there must be met. If you have one Form, just close the Form. If you have written a Sub main, exit sub Main.


    Armin

    Wednesday, April 11, 2012 2:08 PM
  • Just use the Process Class and the Start method from program A before it terminates:

    http://msdn.microsoft.com/en-us/library/e8zac0ca.aspx#Y1110


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Wednesday, April 11, 2012 2:13 PM