12
dotnet
protocol_error
ai_generated
true
Grpc.Core.RpcException: Status(StatusCode="Unimplemented", Detail="Method 'ServiceName/MethodName' is unimplemented. If the server is not configured to serve this method, the call will fail.")
ID: dotnet/grpc-unimplemented-method
90%Fix Rate
88%Confidence
1Evidence
2023-08-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 2.45.0 | active | — | — | — |
| 2.46.0 | active | — | — | — |
| 2.47.0 | active | — | — | — |
| 2.48.0 | active | — | — | — |
Root Cause
The gRPC client calls a method that the server does not have a handler registered for, often due to missing service registration, incorrect proto file compilation, or version mismatch between client and server.
generic中文
gRPC 客户端调用了服务器未注册处理程序的方法,通常是由于缺少服务注册、proto 文件编译错误或客户端与服务器版本不匹配。
Official Documentation
https://grpc.io/docs/guides/error/Workarounds
-
90% success Ensure the service is registered in the DI container and endpoint mapping: in Program.cs, add 'app.MapGrpcService<MyServiceImpl>();' and in the service class, inherit from 'MyService.MyServiceBase' and override the method.
Ensure the service is registered in the DI container and endpoint mapping: in Program.cs, add 'app.MapGrpcService<MyServiceImpl>();' and in the service class, inherit from 'MyService.MyServiceBase' and override the method.
-
85% success Regenerate gRPC stubs by running 'dotnet build' after updating the .proto file, or use 'dotnet grpc-aspnetcore-codegen' to ensure both client and server use the same proto definition.
Regenerate gRPC stubs by running 'dotnet build' after updating the .proto file, or use 'dotnet grpc-aspnetcore-codegen' to ensure both client and server use the same proto definition.
中文步骤
Ensure the service is registered in the DI container and endpoint mapping: in Program.cs, add 'app.MapGrpcService<MyServiceImpl>();' and in the service class, inherit from 'MyService.MyServiceBase' and override the method.
Regenerate gRPC stubs by running 'dotnet build' after updating the .proto file, or use 'dotnet grpc-aspnetcore-codegen' to ensure both client and server use the same proto definition.
Dead Ends
Common approaches that don't work:
-
90% fail
Restarting the server without updating the code does not add the missing method handler; the service must be properly registered in Startup.cs or Program.cs.
-
70% fail
Adding a new proto file without regenerating the server stubs leaves the server unaware of the method; the build step must compile the proto to C#.