'How to solved gRPC exeption with this Status(StatusCode="Unimplemented", Detail="Service is unimplemented.")?

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](Method2 method, String host, CallOptions options, TRequest request) at Grpc.Core.Interceptors.InterceptingCallInvoker.<BlockingUnaryCall>b__3_0[TRequest,TResponse](TRequest req, ClientInterceptorContext2 ctx) at Grpc.Core.ClientBase.ClientBaseConfiguration.ClientBaseConfigurationInterceptor.BlockingUnaryCall[TRequest,TResponse](TRequest request, ClientInterceptorContext2 context, BlockingUnaryCallContinuation2 continuation) at Grpc.Core.Interceptors.InterceptingCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method`2 method, String host, CallOptions options, TRequest request) . . . . .



Solution 1:[1]

Share a sample of your proto file

Note: Make sure your .proto file is identical for both client and server and it has the same package. When the client calls a method on the remote server, it uses the full name of the remote class and the package.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user1093452