C# inter process communication

Oct 16, 2010 at 3:16 PM


I'm currently working on the mirroring feature and I want to make an own system tray app which indicates the current health of the mirroring feature. For this I need a bidirectional interface to communicate with the Liquesce service.

Right now I've found different sites on the net but none of them did exactly what I want.


MSMQ (Microsoft Message Queue): I thought this would be the best solution. I need something like a message queue and here it already would be implemented on os level. I've tried to adapt this for my needs but no chance... It always throws an exception which says that the queue is not availabel or has the wrong permissions. Both I checked an should be ok. I've read something that Win7 x64 has strickter security than older os and this could make troubles.

The fact that MSMQ has to be installed seperately, and it is overloaded with full internet support are cons for MSMQ.


Window Messages: I'm not sure how this could work. Since Liquesce can run with multiple threads and all of them have to communicate with the mirroring app is this an elegant solution?


TCP/IP Socket: I've tried this for about half an hour... I'm not sure if I should invest more time to this.


Maybe someone can help and has an easy to use solution. I just wan't to communicate from the service to a process... since the service has multiple threads it should be also possible to have a n to 1 connection to the mirroring app which results in a queue.


Oct 16, 2010 at 3:25 PM

I vote against MSMQ (was planning to reply and then I read you had the same thoughts as me). MSMQ needs an additional setup. Fine for servers (fine for me too, I possibly already have it installed for some reason), but not cool for desktops.

I also vote against a separate system tray app!!!

It is possibly ok for your betas in the meantime, but instead in the "end product" I'd like A SINGLE system tray app, able to gather messages from ALL the subsystems of Liquesce. You probably have to arrange for this along with Smurf. In fact Smurf should dig a bit about this on his own too as the current tray app DOES NOT update properly (I have already opened an issue about mine always saying "Liquesce is starting").

Also (and possibly can only be done through TCP/IP socket) this tray app SHOULD NOT BE LIMITED to the machine Liquesce is running on! In many cases (most cases?) people will run Liquesce in a machine and see the end product in other machines. There the "management and reporting" application (the tray app thing) should be able to communicate to the service(s) over network.


"bye" (cute - first time I read it, I thought you were leaving... reminds me of some other guy in a forum who always signs his posts like email "yours faithfully" and such :D)


Oct 16, 2010 at 4:09 PM

OK... I would say I can drop the MSMQ thing...

But right now I want to have an own application for the mirroring feature because of two reasons:

1. To not infect liquesce with performance issues or other troubles

2. To be able to run liquesce without mirroring and having no overhead.

Later we can think of merging all modules and presenting them as one big app.


But right now I need codesamples / documentations / tutorials for coding an ipc in C#. There is no need of having a solution which is network/internet ready because mirroring is only locally possible (at the moment).

Oct 16, 2010 at 5:35 PM
NLS wrote:
(I have already opened an issue about mine always saying "Liquesce is starting").

That has been closed as fixed inthe latst Alpha.. Did you not get an email about that (Not sure if Codeplex send those - So I had assumed that you had already recieved notifcation about is being closed)

Oct 16, 2010 at 5:38 PM
fpdragon wrote:
But right now I need codesamples / documentations / tutorials for coding an ipc in C#. There is no need of having a solution which is network/internet ready because mirroring is only locally possible (at the moment).

Use the existing Tray application.

This will work across machines if necessary as it uses the Werll documented WCF patterns to get callbacks and also to send requests for updates / status etc.

Currently it just gets events to state when things have sucessfully been restored (From a seperate thread)

So just follow it back from the tray application into the code.

If you want another interface for a seperate application, then just tag another one in (There are already 2 Eventsand Directed calls)

WCF handles allmost  the queuing things for you via thread pools etc.

Oct 16, 2010 at 6:27 PM

missed that!

I wonder if any of my tests is way wrong because I am still using 6/10...


Oct 17, 2010 at 8:46 AM

OK. I've tried to use this already used interface between LiquesceSvc.exe and Liquesce.exe to get a communication from LiquesceSvc.exe to LiquesceMirrorTray.exe but it seems that I am missing something.

I have no syntax errors and can start LiquesceMirrorTray.exe. The LiquesceFacade.dll is shown in the build directory.

GetMirrorDeleteToDo() should be accessable because if I press the '.' after remoteIF, I can see the method in the list. See the code:

                ChannelFactory<ILiquesce> factory = new ChannelFactory<ILiquesce>("LiquesceFa�ade");
                ILiquesce remoteIF = factory.CreateChannel();
            catch (Exception ex)
                MessageBox.Show(this, ex.Message, "Has the firewall blocked the communications ?", MessageBoxButtons.OK,

When I start the code I get a popup like this: (translated to english)


Has the firewall blocked the communications ?


There is no end point element with the name "LiquesceFacade" and the Contract "LiquesceFacade.ILiquesce" in ServiceModel-client configuration sectionfound.

This can happen if: Your application has no configuration file or in the clientelement there is no endpoint element that has the right name.

(sorry for the bad english)


Any ideas?

By the way: I don't think that it is a good idea to use this special characters like the c in Facade but this shouldn't be the problem here since I've copied the parts.

Oct 17, 2010 at 9:24 AM

Can I use this thread to request a way to install the tray on a computer to connect to a remote computer?

(erm, stupid syntax... I mean install it on a client and have it report messages from a server)

User-friendliest way would be to use the same installer but just separate installed features. In the future I expect something like:

Please choose what to install (choose all that apply)

  • Client application [tray icon and configurator]
  • View merging service [current liquesce]
  • File based mirroring [what fpdragon is working now]
  • File based snapshot parity [erm... ok]
  • Block based parity [I can dream can't I?]
  • Core [always selected except if just client application is chosen]


Less will suffice for a start, but I'd love to see something like that eventually.


Oct 17, 2010 at 10:44 AM

please open a new thread for installer ideas...

right now I want to solve the problem with the ipc here.

Oct 17, 2010 at 12:23 PM

I think I've found the problem. I had no App.config. Strange this C# things ;)

Oct 20, 2010 at 9:06 AM

I've had some testing and implementation with the early version of the MirrorGUI. IPC was working with the LiquesceFacade mechanism. I've got a List<string> from LiquesceSvc and everything worked fine.

Then I changed the List<string> to my own class (a class which holds all communication values and some methods for easy usage). No errors no warning. No data :-( It seems that the data of the object is cleared during the LiquesceFacade communication.

Do I need to take care of something when using a class instead of a standard string?

The class is set to public and I can see it in LiquesceSvc and LiquesceMirroTray project. So no syntax errors. Do I have to add something to let the C# thing know how it can pipe the whole class object through a tcp/ip port. I'm getting more and more confused with this interface...

I noticed that the Liquesce project (config app) has also an interface to the LiquesceSvc with an user defined class (ConfigDetails), but I see no differences to my current implementation. I'm expecting that I am missing a config in the Visual Studio Settings. Or again something with these .xml files?

If anybody has a idea then please tell.

Oct 21, 2010 at 6:58 AM

problem solved (again)

Some tags in the new class were missing which seems to mark the object specific data. Anyway... It works now.

Oct 21, 2010 at 9:21 AM

Way to go man!

(this project already has two devs... hint hint hint for others)


Oct 21, 2010 at 1:40 PM
NLS wrote:

Way to go man!

(this project already has two devs... hint hint hint for others)


Sorry, what does this mean?

Oct 21, 2010 at 4:55 PM


Certain language and cultural barriers here.. (Greek, German, American, English etc :-)

So -

- Way to go = probably well done with sticking with it and learning a bit more about c#.

- others = I think NLS would like some input from certain other Dokan developers and developer users to help out and see if a more encompassing solution can be progressed, that allows for all the features that have so far been mentioned to worked upon..

I hope that is a fair interpretation