What's the best way to pass data from one Windows Forms app (an office plugin) to another (exe written in C#) in C#?
I'll take a wild stab at this and say you probably want the office app to phone home to your exe? In this context, the "exe" is the server and the office app is the client.
If you're using .NET 3.0, WCF is likely your best bet. I would structure the solution into three parts:
Both the "exe" and the "plugin" will require configuration files that define the bindings.
When you want to pass data between client and server, your client will create an object from the "Shared Contracts" assembly and pass it to the service-client. The client's configuration file will figure out where to send the data.
For a step-by-step tutorial on how to create a basic WCF service, check out this Tutorial.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With