All, I am developing an application that needs to launch another application at run-time. To launch the third-party app I am using System.Diagnostics.Process and to ensure I never launch the third-party application twice I employ a singleton pattern.
The singleton is working is required, but Process.Start() method is not. That is although I am getting the same Process object returned from the singleton, Start() is launching another instance of the third-part app.
From MSDN – Process.Start() page:
"Starts (or reuses) the process resource that is specified by the StartInfo property
of this Process component and associates it with the component."
suggest that it should reuse the instance of the Process. What am I missing?
Thanks for your time.
Here is the function I use to start third party applications:
ExecutablePath: Full path to the executable
sArgs: Command line arguments
bWait: Wait for the process to exit
In my case I use a secondary function to determine if the process is already running. This is not exactly what you are looking for, but it will still work: