Introduction

A while ago, I published a post that explained how to expose proto files within an ASP.NET Core gRPC app using Route-To-Code that you can find here: Exposing proto files in a gRPC service over a frameworkless and lightweight API – Anthony Giretti’s .NET blog

I only explained how to expose them and access them from a browser. But I haven’t explained how to download them from “Services References” menu in Visual Studio 2019, and I should have because there is a trick.

gRPC works only with HTTP/2

And that’s the trick! Kestrel in a gRPC service template, will ONLY expose endpoints on HTTP/2 because gRPC works only on HTTP/2. If you take the following endpoint that I use to expose a proto file: https://localhost:5001/protos/v2/country.proto it will work in a browser but not in Visual Studio 2019.

#grpc #grpc client #visual studio 2019 #aspdotnet core #aspdotnet core 5

gRPC & ASP.NET Core 5: Add a gRPC service reference
2.35 GEEK