gRPC Server and Client inside desktop winforms and WPF Desktop app .net framework 4.8...how?

378 Views Asked by At

i need make 2 exes communicate, the problem: one is in 4.8 and the other in .net 6 (core) WCF don't work on .net 6 and gRPC seams to not work on 4.8...so i am on a deadlock

how create this communication, WCF in 4.8 is literally 3 lines:

var serviceHost = new ServiceHost(typeof(Service), new Uri[] { new Uri("net.pipe://localhost/MyAppNameThatNobodyElseWillUse2") });
serviceHost.AddServiceEndpoint(typeof(IService), new NetNamedPipeBinding(), "helloservice");
serviceHost.Open();

and gRPC in .net 6 is a little more complicated but also simple, just put the proton folder, enable indirect reference to generate de proton class on build and some lines:

var builder = WebApplication.CreateBuilder();

// Despite adding a "launchSettings.json" file to the project, I couldn't find a way 
// for the builder to pick it up, so had to configure the URLs here:
builder.WebHost.UseUrls("http://*:5218", "https://*:7219");

builder.Services.AddGrpc();

var _app = builder.Build();
_app.MapGrpcService<GreeterService>();
_app.Run();

again: the problem is that .net 6 do not support WCF and the supposed coreWCF don't seam to work in a desktop wpf project...at last o can't config that someone was some code? simple the better like above, include the nugets,reference and name files please

and the gRPC do not work on 4.8, no matter what i do proton is not detected

anyone was a solution, make one of those 2(3 with coreWFC) work on both and in each desktop app has a server and client to communicate?

1

There are 1 best solutions below

0
On

The minimum version applicable to gRPC is.NET 5 and wcf does not support.NET core.

If you want to use something like wcf, look at the solutions in these two cases : What replaces WCF in .Net Core? and How use wcf from wpf developed in .net core 3.0.