Building a gRPC service and client
Let’s see an example service and client for sending and receiving simple messages.
Building a Hello World gRPC service
We will start by building the gRPC service using one of the project templates provided as standard:
- Use your preferred code editor to create a new project, as defined in the following list:
- Project template: ASP.NET Core gRPC Service /
grpc
- Solution file and folder:
Chapter13
- Project file and folder:
Northwind.Grpc.Service
- Enable Docker: Cleared.
- Do not use top-level statements: Cleared.
- Enable native AOT publish: Selected.
Good Practice: Make sure to select Enable native AOT publish. With .NET 8 and later, gRPC projects can be ahead-of-time (AOT) compiled for native platforms. This gives improved performance and a reduced start time, which is important for microservices that are frequently redeployed and spun up and down...
- Project template: ASP.NET Core gRPC Service /