You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add gRPC client and server sample for ASP.NET Core 10 (#36732)
* Add gRPC client and server sample for ASP.NET Core 10
* fix the reference to vs-10
* Apply suggestions from code review
Co-authored-by: Wade Pickett <wpickett@microsoft.com>
---------
Co-authored-by: Wade Pickett <wpickett@microsoft.com>

4
+
5
+
Select **Yes** if you trust the IIS Express SSL certificate.
6
+
7
+
The following dialog is displayed:
8
+
9
+

10
+
11
+
Select **Yes** if you agree to trust the development certificate.
Copy file name to clipboardExpand all lines: aspnetcore/tutorials/grpc/grpc-start.md
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ author: jamesnk
4
4
description: This tutorial shows how to create a gRPC Service and gRPC client on ASP.NET Core. Learn how to create a gRPC Service project, edit a proto file, and add a duplex streaming call.
5
5
monikerRange: '>= aspnetcore-3.0'
6
6
ms.author: wpickett
7
-
ms.date: 01/30/2025
7
+
ms.date: 02/02/2026
8
8
uid: tutorials/grpc/grpc-start
9
9
---
10
10
# Tutorial: Create a gRPC client and server in ASP.NET Core
11
11
12
-
:::moniker range=">= aspnetcore-9.0"
12
+
:::moniker range=">= aspnetcore-10.0"
13
13
This tutorial shows how to create a .NET [gRPC](xref:grpc/index) client and an ASP.NET Core gRPC Server. At the end, you'll have a gRPC client that communicates with the gRPC Greeter service.
14
14
15
15
In this tutorial, you:
@@ -23,23 +23,23 @@ In this tutorial, you:
23
23
24
24
# [Visual Studio](#tab/visual-studio)
25
25
26
-
[!INCLUDE[](~/includes/net-prereqs-vs-9.0.md)]
26
+
[!INCLUDE[](~/includes/net-prereqs-vs-10.md)]
27
27
28
28
# [Visual Studio Code](#tab/visual-studio-code)
29
29
30
-
[!INCLUDE[](~/includes/net-prereqs-vsc-9.0.md)]
30
+
[!INCLUDE[](~/includes/net-prereqs-vsc-10.0.md)]
31
31
32
32
---
33
33
34
34
## Create a gRPC service
35
35
36
36
# [Visual Studio](#tab/visual-studio)
37
37
38
-
* Start Visual Studio 2022 and select **New Project**.
38
+
* Start Visual Studio and select **Create a new Project**.
39
39
* In the **Create a new project** dialog, search for `gRPC`. Select **ASP.NET Core gRPC Service** and select **Next**.
40
40
* In the **Configure your new project** dialog, enter `GrpcGreeter` for **Project name**. It's important to name the project *GrpcGreeter* so the namespaces match when you copy and paste code.
41
41
* Select **Next**.
42
-
* In the **Additional information** dialog, select **.NET 9.0 (Standard Term Support)** and then select **Create**.
42
+
* In the **Additional information** dialog, select **.NET 10.0 (Long Term Support)** and then select **Create**.
43
43
44
44
# [Visual Studio Code](#tab/visual-studio-code)
45
45
@@ -64,7 +64,7 @@ The tutorial assumes familiarity with VS Code. For more information, see [Gettin
64
64
65
65
### Run the service
66
66
67
-
[!INCLUDE[](~/includes/run-the-app9.0.md)]
67
+
[!INCLUDE[](~/includes/run-the-app10.0.md)]
68
68
69
69
The logs show the service listening on `https://localhost:<port>`, where `<port>` is the localhost port number randomly assigned when the project is created and set in `Properties/launchSettings.json`.
> The gRPC template is configured to use [Transport Layer Security (TLS)](https://tools.ietf.org/html/rfc5246). gRPC clients need to use HTTPS to call the server. The gRPC service localhost port number is randomly assigned when the project is created and set in the *Properties\launchSettings.json* file of the gRPC service project.
81
+
> The gRPC template is configured to use [Transport Layer Security (TLS)](https://tools.ietf.org/html/rfc5246). gRPC clients need to use HTTPS to call the server. The gRPC service localhost port number is randomly assigned when the project is created and set in the *Properties\launchSettings.json* file of the gRPC service project.
82
82
83
83
### Examine the project files
84
84
85
85
*GrpcGreeter* project files:
86
86
87
87
*`Protos/greet.proto`: defines the `Greeter` gRPC and is used to generate the gRPC server assets. For more information, see [Introduction to gRPC](xref:grpc/index).
88
88
*`Services` folder: Contains the implementation of the `Greeter` service.
89
-
*`appSettings.json`: Contains configuration data such as the protocol used by Kestrel. For more information, see <xref:fundamentals/configuration/index>.
89
+
*`appsettings.json`: Contains configuration data such as the protocol used by Kestrel. For more information, see <xref:fundamentals/configuration/index>.
90
90
*`Program.cs`, which contains:
91
91
* The entry point for the gRPC service. For more information, see <xref:fundamentals/host/generic-host>.
92
92
* Code that configures app behavior. For more information, see [App startup](xref:fundamentals/startup).
* In the preceding highlighted code, replace the localhost port number `7042` with the `HTTPS` port number specified in `Properties/launchSettings.json` within the `GrpcGreeter` service project.
209
209
@@ -214,17 +214,17 @@ The Greeter client is created by:
214
214
* Instantiating a `GrpcChannel` containing the information for creating the connection to the gRPC service.
215
215
* Using the `GrpcChannel` to construct the Greeter client:
0 commit comments