Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are a few ways you can run the same executable as the present instance in C#, without using Process.Start(). Here are two ways:

  1. Use AppDomain.ExecuteAssembly():
AppDomain.CurrentDomain.ExecuteAssembly(Assembly.GetEntryAssembly().Location);

This will execute the same executable as the present instance.

  1. Use Reflection to call the main method:
MethodInfo method = typeof(Program).GetMethod("Main");
method.Invoke(null, null);

Replace "Program" with the name of your program class if it's different. This will call the Main() method of the same executable, effectively running it again.