0

I have an application that one of the functions it does is act as a central file console to where commonly accessed files can be tracked and launched from.

The problem I am having is when the user double clicks the file name or opens it by the open button and does their work inside the worksheet and tries to close the excel application from excel it throws a messagebox the it has stopped working.

Here is the code that launches it:

private void _OpenResource(string path)
{
    ProcessStartInfo psi = new ProcessStartInfo(path);
    psi.UseShellExecute = true;
    psi.WindowStyle = ProcessWindowStyle.Maximized;
    Process proc = new Process {StartInfo = psi};
    proc.Start();
}

The main intent here is that we're wanting to use the current registered app path for whatever type file is passed into it. The tag has excel listed but it is happening on word, firefox and many others.

Is there a way to launch a process a disconnected from my launching app, sometimes the launching app will be closed down before the launched app is closed down.

  • 1
    I tested this in a console application and everything closes gracefully. Can you provide a minimal example which could demonstrate the problem you are having? – djv May 04 '16 at 21:33
  • 1
    Works fine in WinForms as well. – djv May 04 '16 at 21:42
  • Thanks Verdolino, after reading your replies I tried it on my computer at home and it does in fact work. It must be something with the way the work computer is configured (managed by an IT group) when I get in today I will chase it down from a different angle, glad to know at least the code is working. Thanks again. – GreenBetweenTheBraces May 05 '16 at 13:02

0 Answers0