title: grpc server shows "unimplemented service error"
body: <p>I have created a grpc server and client after this instruction: <a href="https://docs.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-3.0&amp;tabs=visual-studio" rel="noreferrer">https://docs.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-3.0&amp;tabs=visual-studio</a>.</p>
  
  <p>When i try to call the service from the client the client show this error message: "One or more errors occurred. (Status(StatusCode=Unknown, Detail="No status received"))"</p>
  
  <p>And the server this one:</p>
  
  <pre><code>info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
        Request starting HTTP/2 POST http://STEINI-PC/LocationService/GetLocations application/grpc
  info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
        Executing endpoint 'gRPC - gRPC - Unimplemented service'
  info: Grpc.AspNetCore.Server.Internal.ServerCallHandlerFactory[1]
        Service 'LocationService' is unimplemented.
  info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
        Executed endpoint 'gRPC - gRPC - Unimplemented service'
  info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
        Request finished in 51.812000000000005ms 200 application/grpc
  </code></pre>
  
  <p>Proto File: </p>
  
  <pre class="lang-proto prettyprint-override"><code>syntax = "proto3";
  
  service EventService {
      rpc GetEvents (Empty) returns (Events) {}
      rpc GetEvent (Id) returns (Event) {}
      rpc GetEventsByLocation (Id) returns (Events) {}
      rpc AddEvent (Event) returns (Empty) {}
      rpc UpdateEvent (Event) returns (Empty) {}
      rpc DeleteEvent (Id) returns (Event) {}
  }
  
  service LocationService {
      rpc GetLocations (Empty) returns (Locations) {}
      rpc GetLocation (Id) returns (Location) {}
      rpc AddLocation (Location) returns (Empty) {}
      rpc UpdateLocation (Location) returns (Empty) {}
      rpc DeleteLocation (Id) returns (Location) {}
  }
  
  service ParticipantService {
      rpc GetParticipants (Empty) returns (Participants) {}
      rpc GetParticipant (Id) returns (Participant) {}
      rpc GetParticipantsFromEvent (Id) returns (Participants) {}
      rpc AddParticipant (Participant) returns (Empty) {}
      rpc UpdateParticipant (Participant) returns (Empty) {}
      rpc DeleteParticipant (Id) returns (Participant) {}
  }
  
  message Empty {
  
  }
  
  message Id {
      string id = 1;
  }
  
  message Events{
      repeated Event events = 1;
  }
  
  message Locations{
      repeated Location locations = 1;
  }
  
  message Participants{
      repeated Participant participants = 1;
  }
  
  message Event {
      Id eventid = 1;
      string name = 2;
      string description = 3;
      Id locationID = 4;
      string date = 5;
  }
  
  message Location {
      Id locationID = 1;
      string name = 2;
      string adress = 3;
  }
  
  message Participant {
      Id participantId = 1;
      string name = 2;
      Id eventId = 3;
  }
  </code></pre>
  
  <p>Server Startup: </p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Startup
      {
          // This method gets called by the runtime. Use this method to add services to the container.
          // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
          public void ConfigureServices(IServiceCollection services)
          {
              var connectionString = @"Data Source=STEINI-PC;Initial Catalog=thesisSteinmetz;Persist Security Info=True;User ID=SA;Password=SA123";
  
              services.AddGrpc(options =&gt;
              {
                  options.EnableDetailedErrors = true;
              });
              services.AddDbContext&lt;DataContext&gt;(options =&gt; options.UseSqlServer(connectionString));
          }
  
          // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
          public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
  
              app.UseRouting();
  
              app.UseEndpoints(endpoints =&gt;
              {
                  // Communication with gRPC endpoints must be made through a gRPC client.
                  // To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909
                  endpoints.MapGrpcService&lt;EventService&gt;();
                  endpoints.MapGrpcService&lt;LocationService&gt;();
                  endpoints.MapGrpcService&lt;ParticipantService&gt;();
              });
          }
      }
  </code></pre>
  
  <p>Location Service:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class LocationService : LocationServiceBase
      {
          private readonly DataContext _context;
          private readonly ILocationDataHandler _locationDataHandler;
  
  
          //public LocationService()
          //{
          //    var connectionString = @"Data Source=STEINI-PC;Initial Catalog=thesisSteinmetz;Persist Security Info=True;User ID=SA;Password=SA123";
          //    var contextOptions = new DbContextOptionsBuilder&lt;DataContext&gt;();
          //    contextOptions.UseSqlServer(connectionString);
  
          //    _context = new DataContext(contextOptions.Options);
          //    _locationDataHandler = new EFCoreLocationDataHandler(_context);
          //}
  
          public LocationService(DataContext context)
          {
              _context = context;
              _locationDataHandler = new EFCoreLocationDataHandler(_context);
          }
  
  
          public override async Task&lt;Empty&gt; AddLocation(Location request, ServerCallContext context)
          {
              await _locationDataHandler.AddAsync(LocationConverter.LocationFromGRPC(request));
  
              return new Empty();
          }
  
          public override async Task&lt;Location&gt; DeleteLocation(Id request, ServerCallContext context)
          {
              try
              {
                  CommonLibrary.Models.Location location = await GetLocation(request);
  
                  await _locationDataHandler.DeleteAsync(location.LocationId);
  
                  return LocationConverter.LocationToGRPC(location);
              }
              catch (Exception ex)
              {
                  throw new RpcException(new Status(StatusCode.NotFound, ex.Message));
              }
          }
  
          public override async Task&lt;Location&gt; GetLocation(Id request, ServerCallContext context)
          {
              try
              {
                  return LocationConverter.LocationToGRPC(await GetLocation(request));
              }
              catch (Exception ex)
              {
                  throw new RpcException(new Status(StatusCode.NotFound, ex.Message));
              }
          }
  
          public override async Task&lt;Locations&gt; GetLocations(Empty request, ServerCallContext context)
          {
              return LocationConverter.LocationsToGrpc(await _locationDataHandler.GetAsync());
          }
  
          public override async Task&lt;Empty&gt; UpdateLocation(Location request, ServerCallContext context)
          {
              try
              {
                  await _locationDataHandler.UpdateAsync(LocationConverter.LocationFromGRPC(request));
              }
              catch (Exception ex)
              {
  
                  throw new RpcException(new Status(StatusCode.NotFound, ex.Message));
              }
              return new Empty();
          }
  
  
          private async Task&lt;CommonLibrary.Models.Location&gt; GetLocation(Id request)
          {
              var location = await _locationDataHandler.GetAsync(IdConverter.IdToGuid(request));
  
              if (location == null)
              {
                  throw new Exception($"Location with id: {location.LocationId.ToString()} Not Found");
              }
  
              return location;
          }
      }
  </code></pre>