What’s the best way to pass data from one Windows Forms app (an office plugin) to another (exe written in C#) in C#?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.