Migrating from C# Grpc.Core to Grpc.Net: Interceptors

41 views
Skip to first unread message

Derek Antrican

unread,
Jul 30, 2025, 6:24:56 PM7/30/25
to grpc.io
I'm trying to migrate a tool of medium complexity from Grpc.Core to Grpc.Net. I've tried using AI to assist in this, but it hallucinates often between the two libraries, often telling me "add a reference to Grpc.Core.Api - it just contains shared types, so it's fine", but as far as I can tell, all Grpc.Core packages will eventually be deprecated.

One thing I need to migrate (amongst several other files) is our Interceptor. This is very simple as we're basically using it to override `UnaryServerHandler` and `AsyncUnaryCall` so we can get the metadata req_id for each message (for logging).

Looking at docs at https://learn.microsoft.com/en-us/aspnet/core/grpc/interceptors?view=aspnetcore-9.0 and the example at https://github.com/grpc/grpc-dotnet/tree/master/examples/Interceptor , as far as I can tell, these are all based on Grpc.Core? Is there an example for Grpc.Net? Does the Interceptor type exist in Grpc.Net?

This comparison doc https://github.com/grpc/grpc-dotnet/blob/master/doc/implementation_comparison.md#interceptors says "Both implementations support client and server interceptors from Grpc.Core.Interceptors namespace", but again I thought all Grpc.Core packages were being deprecated?
Reply all
Reply to author
Forward
0 new messages