Question

I am currently developing a visual c# application which shall run in background on the first instance "A" it was created. Now, I want that for the other time "B" the same application is run, the arguments in "B" be passed and processed in the existing instance "A". Thus, the "B" will not anymore open a new background application.

I already have searched about making a single instance applications but never have I encountered any solution to this problem of passing the arguments to the running instance.

Was it helpful?

Solution

The only way to solve your problem in my experience is with some form of inter-process communication - Named Pipes, Memory Mapped file, even TCP/WCF are all candidates. So you would use a Mutex to detect if instance A is already running and then connect to it via IPC to pass the parameters.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top