tags:

views:

83

answers:

4

What is the best way to pass data from one .NET application to another at run-time?

Basically I need to transfer a 10-100 kilobytes of data in a few minutes from one app to another (locally) and get response for this action.

Ideally - ability to sign on events in another app, and ability to call methods of classes in another app.

Thanks!

+9  A: 

Since you're doing this in .NET, I'd strongly recommend looking into Windows Communication Foundation.

It will take care of the infrastructure (and have the benefit of allowing you to easily reconfigure to not require the two apps to be local, if your requirements change).

"Passing data" will be very obvious once you start reading up on WCF. Here is an article describing how to handle callbacks and events in WCF, as well.

Reed Copsey
sorry for my answer, I did not see yours
Pierre 303
+4  A: 

In the past I would have told you .NET Remoting, but now with WCF it's easier:

http://msdn.microsoft.com/en-us/library/aa730857.aspx#netremotewcf_topic7

Pierre 303
I question the value of confusing the OP with a comparison between old technologies and new, since he isn't using either of them.
John Saunders
I don't know what he is using. Remoting would have been the obvious choice before WCF, and I mention it just because WCF is a lot more than a remoting replacement.
Pierre 303
+4  A: 

I agree with using WCF for your scenario, as there is not much data to be transferred.

Since you are talking about IPC you could also look into using signaling and shared memory. I have a blog post comparing WCF to using shared memory (in terms of speed). By using EventWaitHandle it's easy to trigger events between processes on the same machine, and the code is fairly trivial.

With WCF you would need to set up a Duplex service in order to get events back and forth. In my opinion even remoting is easier to set up when it comes to doing events between processes. But if you need handling between machines, use WCF.

Mikael Svenson
A: 

WCF was introduced in .NET 3.0, so if you are using that or later, I highly recommend it. It's very easy to setup and they have some quick videos to get you going on MSDN: http://msdn.microsoft.com/en-us/netframework/first-steps-with-wcf.aspx

It also gives you the ability to setup "Endpoints" to let you automatically (once configured) allow communication via TCP, HTTP, named pipes, etc.

CrypticPrime