Launching one c# application from another

J

John A. Bailo

Excuse the novice aspects of this question, but:

What techniques are available to me for launching one c# application (
console .exe) from another?

For example, I know there is the Process and ProcessInfo classes, but
these seem designed for launching non-CLR applications.

Should I access the .exe as a reference?

Or dynamically invoke it, or just invoke its methods?

Should I use Reflection?

Is there a way to "launch" it so that once its running, it's entirely
detached from the calling application?

Is that what Reflection.Emit is for?

Is there a proper way to load a new Application space for a second
application, and is this the way to do what I am asking?

Can you direct me to any good references on the topic...I've been
Googling all weekend and everything seems to talk about launching a DOS
application (using Process) not about a c# app launching another c#?
 
J

John A. Bailo

Maybe this answers my question, or part of it(?):

http://msdn.microsoft.com/library/d...fSystemAppDomainClassExecuteAssemblyTopic.asp


class Test {
public static void Main() {
AppDomain currentDomain = AppDomain.CurrentDomain;
AppDomain otherDomain = AppDomain.CreateDomain("otherDomain");

currentDomain.ExecuteAssembly("MyExecutable.exe");
// Prints "MyExecutable running on [default]"

otherDomain.ExecuteAssembly("MyExecutable.exe");
// Prints "MyExecutable running on otherDomain"
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top