grpc / grpc-dotnet

gRPC for .NET
Apache License 2.0
4.22k stars 776 forks source link

Running in injected DLL without ASP.NET #2541

Closed just-ero closed 2 months ago

just-ero commented 2 months ago

Question

Hello, I am injecting a C# NativeAOT assembly into another process. I want to communicate with that process. Send requests and replies. I wanted to try and use Grpc for this, but it seems like I cannot do so without ASP.NET. Aside from being incompatible with the target framework, it may not be the best idea to start a web server from within a remote process.

How do I do this?
Otherwise, what similarly easy, .NET Standard 2.0-compatible implementation can I choose to exchange messages over named pipes?

JamesNK commented 2 months ago

No. The gRPC server requires .NET 5+.

You could consider using Grpc.Core, but it brings it some large native dependencies.