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 
<https://visualstudiomagazine.com/articles/2019/10/02/definining-grpc-services.aspx#:~:text=Right-click%20on%20your%20project,%20select%20Manage%20NuGet%20packages,,update%20any%20packages%20listed%20there.>.
  
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

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/efb79d92-c2da-4f47-a301-ae903f62ccdbn%40googlegroups.com.

Reply via email to