Questions tagged [grpc-dotnet]

gRPC for .NET! gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems. https://learn.microsoft.com/en-us/aspnet/core/grpc/?view=aspnetcore-3.0

87 questions
11
votes
1 answer

How to add global exception handler for gRPC services in ASP.NET Core?

I'm writing gRPC services using ASP.NET Core using GRPC.ASPNETCore. I've tried to add an Exception Filter for gRPC methods like this services.AddMvc(options => { options.Filters.Add(typeof(BaseExceptionFilter)); }); or using the…
Dmitriy
  • 847
  • 17
  • 39
7
votes
1 answer

.Net 5: Hosting ASP.NET Core gRPC Service in IIS 10 at Windows Server 2019

According to this post in Microsoft Doc and this warning section: ASP.NET Core gRPC has extra requirements for being used with Azure App Service or IIS. For more information on where gRPC can be used, see gRPC on .NET supported platforms. I…
Hasan Fathi
  • 5,610
  • 4
  • 42
  • 60
7
votes
1 answer

Create interfaces for gRPC client for unit tests

I have a dotnet core 3 console app project with a generated gRPC client (using the Protobuf element in the csproj below). I would like to unit test my code. Is there a way to generate my gRPC client to include interfaces for the generated classes so…
Stephen Yeager
  • 113
  • 1
  • 8
5
votes
0 answers

Read request body in dot net core middleware for grpc

I am having one single service that is hosing both API controllers and GRPC with dot net core 3.1. I have middlewares that need to work for both (API and GRPC) and I have a need to read Request Body in it. I tried the below approach, where it works…
Shabbir
  • 51
  • 1
5
votes
2 answers

Transport failed error when using a Java based Grpc server with a C# based client

I am developing a java based Grpc server using spring boot (2.2.2) and the grpc-server-spring-boot-starter java library. My client application is a C# application (netcoreapp3.1). Both the applications run on my laptop for this test. This is my…
Aaron Dsouza
  • 121
  • 3
  • 9
4
votes
2 answers

gRPC file upload always returns The request stream was aborted

Im trying to upload a file from the client to the server in chunks. Is been ten years since I have tried to code a chunk uploader myself, this is harder then I remember. upload.proto syntax = "proto3"; option csharp_namespace =…
Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
4
votes
0 answers

How can I make a GRPC call for a service which is inside a subdirectory? (in .Net Framework)

I am trying to connect to a gRPC service in a .NetFramework 4.5 windows application. I am currently using metapackage nuget Grpc which I know is only in maintenance mode now... I need to access the service which is not at a host:port location, but…
AndreeaGr
  • 41
  • 2
4
votes
2 answers

Should gRPC channels be singleton, scoped or transient in .NET dependency injection?

gRPC requests in .NET rely on channels, that must be shut down and disposed: using var channel = Grpc.Net.Client.GrpcChannel.ForAddress("path to service"); //...do stuff... await channel.ShutdownAsync(); I'm wrapping this in a .NET dependency…
Keith
  • 150,284
  • 78
  • 298
  • 434
4
votes
1 answer

What is a better way to return a Grpc validation error

I would like to know if there is a pattern for field validation in grpc services. I know that RpcException has metadata trailers property and that I can add additional information about my errors. My question is: There is a pattern to be followed?…
kelvin sand
  • 413
  • 4
  • 13
4
votes
1 answer

Trigger HealthCheck by code in aspnet core

I am working with microservice (multiple services) and want to have HealthCheck service which I can call and get health of all the running service. I wan't to trigger healthcheck for each of the service. The idea is to get health of each service via…
hbe
  • 43
  • 5
3
votes
0 answers

AWS API Gate Way with dotnet GRPC server side streaming

I am planning to use AWS APi Gate to in pair with dotnet GRPc HTTP2 protocol. Before making the move I want to make sure AWS gateway will support all the features we already rely on. One of the features we rely on is Server side streaming. Sample…
kkdeveloper7
  • 497
  • 2
  • 11
  • 25
3
votes
1 answer

migrating from grpc.core to grpc-dotnet

We want to migrate our project from grpc.core to gprc-dotnet. In my grpc server I reference the packages Grpc.AspNetCore. The proto file is compiled in a different project and shared. When I implement my server method like: **using…
3
votes
1 answer

Self hosted GRPC server

I am attempting to transition away from WCF to move our codebase across to .NET Core. Our services are all hosted as Windows services at present so am trying to self-host the gRPC service as well (rather than building AspNetCore applications). I…
mike
  • 3,146
  • 5
  • 32
  • 46
3
votes
0 answers

grpc-dotnet authentication jwt bearer token

I am looking for some feedback or guidance. I have built a grpc server and client in dotnet core 3.1. Only this client will be talking to the server, but still need to protect the server endpoints. I am trying to implement authentication security…
Nvious1
  • 33
  • 4
3
votes
1 answer

How to map property of type repeated of proto file to list property of C# class using Automapper?

I have a proto file with following details: TestGRPC.proto: syntax = "proto3"; option csharp_namespace = "MyGRPC"; package MyApi; service Author { rpc GetArticles (ArticleRequest) returns (ArticleResponse); } message ArticleRequest { int32…
santosh kumar patro
  • 7,231
  • 22
  • 71
  • 143
1
2 3 4 5 6