title: Process catching exception
body: <p>I have a process which starts an .exe which throws exception. Is there a way for the process to catch the exception?</p>
  
  <p>I've tried this so far:</p>
  
  <pre><code>Assembly assembly = Assembly.LoadFrom("ConsoleApplication1.exe");
  Type[] types = assembly.GetTypes();
  foreach (Type t in types)
  {
      MethodInfo method = t.GetMethod("Main",
          BindingFlags.Static | BindingFlags.NonPublic);
      if (method != null)
      {
          try
          {
              method.Invoke(null, null);
          }
          catch (Exception ex)
          {
              Console.WriteLine(ex.Message);
          }
          break;
      }
  }
  </code></pre>
  
  <p>but I get an exception on the first line, saying that the .exe can't be found.
  I've also tried this:</p>
  
  <pre><code>Process myProcess = new Process();
  
  myProcess.StartInfo.UseShellExecute = false;
  myProcess.StartInfo.FileName = "C:\\Users\\John\\Documents\\Visual Studio 2010\\Projects\\ConsoleApplication1\\ConsoleApplication1\\bin\\Debug\\ConsoleApplication1.EXE";
  myProcess.StartInfo.CreateNoWindow = true;
  myProcess.Start();
  </code></pre>
  
  <p>but when I debug, there isn't any exception, and the ConsoleApplication1.exe doesn't show up.</p>