From the course: Learning ASP.NET Core: MVC, Razor Pages, Web APIs & Other Foundations
Unlock this course with a free trial
Join today to access over 24,600 courses taught by industry experts.
Calling gRPC services
From the course: Learning ASP.NET Core: MVC, Razor Pages, Web APIs & Other Foundations
Calling gRPC services
- [Instructor] You can create GRPC clients using lots of different programming languages. I'm going to show you a very basic example with a console application in C sharp. I'll start by opening the VS code terminal and using the dotnet CLI to create a new console app. I'll put it in a folder named GRPC client. With that in place, I want to include the new client app alongside my server app here in VS code. I'll do that with what is known as a VS code workspace. I'll right-click in the project explorer and add the new app folder to a workspace. You can now see I have the folders for the server and client projects available in VS code. I now need to add a few NuGet packages to the client project that will allow it to generate the necessary client code and make requests to a GRPC service. I'll add them in the VS code terminal with the dotnet CLI. The command I'll use is dotnet add. I'll follow that with the name of the project file, the command package, and then the name of the NuGet…