Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

Interprocess Communications

I have a C# application.  I have another exe that runs in the background (that I wrote).  What is the best way to get status information from the background process.  The situation I would like to mimic is in the .net environment- where you kick off a build and the details are echoed back to the output window. 

Is there a way to setup a delegate/event across process boundaries (ideal way)?
or do I need to write info to a log/database and poll in the main app (trying to avoid this)


Sunday, June 5, 2005

There's two potential solutions.

If the child process is writing to the console, then you can override the console handles and suck the output back into your program when you launch.

If you're just looking for a general purpose IPC mechanism, you can either choose one that comes with Win32 (like named pipes), or you can use .NET remoting. I'm sure other solutions exist.

Brad Wilson (
Sunday, June 5, 2005

One of my favorite topics -
In addition to Brad's answers, you can also use a message queue, similar to your log/database method
If you need synchronous communication (doesn't sound like it) .net remoting is probably the best choice.  i think any of these could work asynchronously. 
I would use whichever you (& your organization) are most comfortable supporting.

Friday, June 10, 2005

*  Recent Topics

*  Fog Creek Home