I implemente gRPC in my .net core 3.1 projects. Although it works in my local, does not work on server. I try to implement every things that is necessary in my project to support gRPC. In appsettings I use http2
"EndpointDefaults": {
"Protocols": "Http2;Http"
},
In startup :
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IConfiguration>(Configuration);
services.UseOption<GrpcAddressesOptions>();
services.AddGrpc(o => { o.EnableDetailedErrors = true; });
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddManexLoggerProvider();
if (env.IsDevelopment())
app.UseDeveloperExceptionPage();
else if (env.IsProduction() || env.IsStaging()) app.UseManexExceptionHandler();
app.UseForwardedHeaders();
app.UseHsts();
app.UseRouting();
//TODO CheckEndpoint
app.UseEndpoints(endPoints => {
endPoints.MapGrpcService<GrpcCaller>();
});
}
But it does not work in servers and I receive this exeption:
Grpc.Core.RpcException: Status(StatusCode="Unimplemented", Detail="Service is unimplemented.") at Grpc.Net.Client.Internal.HttpClientCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method
2 method, String host, CallOptions options, TRequest request) at Grpc.Core.Interceptors.InterceptingCallInvoker.<BlockingUnaryCall>b__3_0[TRequest,TResponse](TRequest req, ClientInterceptorContext
2 ctx) at Grpc.Core.ClientBase.ClientBaseConfiguration.ClientBaseConfigurationInterceptor.BlockingUnaryCall[TRequest,TResponse](TRequest request, ClientInterceptorContext2 context, BlockingUnaryCallContinuation
2 continuation) at Grpc.Core.Interceptors.InterceptingCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method`2 method, String host, CallOptions options, TRequest request) . . . . .