views:

13

answers:

2

I need a way to exchange data between a process and a windows service. The process (Windows Form Application, Console Application, in the future also a Web Solution) needs to instruct and interact with the windows service. I want to know which way is the best to accompplish this. I'll write the solution in C#, .NET Framework version does not matter. In the past I've used Remoting (Activator), WCF Interface with Contracts, Inter Process Exchange IPC and some named pipe implementation. What is your experience? Other ways?

A: 

My previous experiences have always been over an IPCChannel, mainly because the only code I've had to be involved in that does any form of inter-process communication. It's never caused me any problems and the code is working away quite merrily as I type.

The only real answer to this question is, whichever you're most comfortable with.

Rob
A: 

I would choose WCF. It is most modern and probably best supported approach at the moment. It "replaced" older technologies in most scenarios. Nice feature of the WCF is that if you need to move your service to other protocol you can do that simply in configuration.

If you expect that windows service will always run on the same machine as other application you can use WCF with netNamedBinding. If you decide to move your service to other machine you will have to change configuration (probably to netTcpBinding) because Named pipes in WCF are limited only to IPC.

Ladislav Mrnka