is gRPC suitable for my particular use case (and I'll need some help if it is)?

42 views
Skip to first unread message

Declan....@Sky.com

unread,
May 6, 2022, 9:49:00 AM5/6/22
to grpc.io
I have a C# WPF project that targets .Net Framework 4.7 which I need to control from a separate application.  This will involve sending it messages to start, stop, pause etc as well as asking questions of it, e.g. it's current state, get data it's generated etc.  The controlling app needs to marshall several instances of the WPF application and needs to be able to create and dispose of them at run time on request.  I have access to the code for the WPF application so can make changes but due to it's size and complexity a root and branch rewrite is not feasible so I can't really change it to target core.

I've had a play with gRPC and have been able to set up a simple Hello World app and really like the way it offers me a proper object model to develop against.  I'd like to use it for the above use case but am hitting some roadblocks as I try.

1. I've looked into how to update an existing application to behave as a gRPC server and found this article.  That say I need to install gRPC.ASPNetCore but that won't install to a project that targets .Net Framework (I'm assuming there's no .Net Framework equivalent, I can't seem to find one).  Further, the other instructions e.g. adding lines to the configure method don't make sense on the context of WPF.  I can't find a similar article that targets WPF so I'm not sure how I'd mimic these changes.

2. I considered adding a server project to the WPF apps solution to essentially act as a wrapper.  This sort of works but I come unstuck creating and disposing of instances.  The controlling app starts the WPF app as a process and passes a port number to it and would then need to rely on the WPF app spinning up a server for itself.  That requires a reference to the server project but the server project requires a reference to the WPF app to carry out it's work so I've got circular references.

Has anyone else used gRPC in a similar scenario and, if so, could you help me overcome these issues?  I think I've reached a point where gRPC simply doesn't work for me but I don't want to give up on it yet because I really like the way it offers me an object model and abstracts away all the serialisation/deserialisation gubbins.

any help will be gratefully recieved
Reply all
Reply to author
Forward
0 new messages