Skip to content

Commit 1dc5a14

Browse files
authored
3.1 update for gRPC-start tutorial and its two sample apps (#18103)
* 3.1 udpate for Updated gRPC-start tutorial and its two sample apps * Update GrpcGreeter.csproj Update per review feedback. * Update GrpcGreeter.csproj Reversing change that caused the merge issue. * Update grpc-start.md Resolving merge conflict with mass no-loc for razor fix that occurred today. * Update GrpcGreeter.csproj Fixing per review. * Update grpc-start.md Addressing merge conflict - ms.date line
1 parent 86153f2 commit 1dc5a14

File tree

6 files changed

+27
-15
lines changed

6 files changed

+27
-15
lines changed

aspnetcore/tutorials/grpc/grpc-start.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ In this tutorial, you:
2828

2929
# [Visual Studio](#tab/visual-studio)
3030

31-
[!INCLUDE[](~/includes/net-core-prereqs-vs-3.0.md)]
31+
[!INCLUDE[](~/includes/net-core-prereqs-vs-3.1.md)]
3232

3333
# [Visual Studio Code](#tab/visual-studio-code)
3434

35-
[!INCLUDE[](~/includes/net-core-prereqs-vsc-3.0.md)]
35+
[!INCLUDE[](~/includes/net-core-prereqs-vsc-3.1.md)]
3636

3737
# [Visual Studio for Mac](#tab/visual-studio-mac)
3838

39-
[!INCLUDE[](~/includes/net-core-prereqs-mac-3.0.md)]
39+
[!INCLUDE[](~/includes/net-core-prereqs-mac-3.1.md)]
4040

4141
---
4242

@@ -125,7 +125,7 @@ info: Microsoft.Hosting.Lifetime[0]
125125

126126
* Open a second instance of Visual Studio and select **Create a new project**.
127127
* In the **Create a new project** dialog, select **Console App (.NET Core)** and select **Next**.
128-
* In the **Name** text box, enter **GrpcGreeterClient** and select **Create**.
128+
* In the **Project name** text box, enter **GrpcGreeterClient** and select **Create**.
129129

130130
# [Visual Studio Code](#tab/visual-studio-code)
131131

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
88
<Protobuf Include="Protos\greet.proto" GrpcServices="Server" />
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Grpc.AspNetCore" Version="2.23.2" />
12+
<PackageReference Include="Grpc.AspNetCore" Version="2.28.0" />
1313
</ItemGroup>
1414

1515
</Project>

aspnetcore/tutorials/grpc/grpc-start/sample/GrpcGreeter/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public static void Main(string[] args)
1515
CreateHostBuilder(args).Build().Run();
1616
}
1717

18+
// Additional configuration is required to successfully run gRPC on macOS.
19+
// For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682
1820
public static IHostBuilder CreateHostBuilder(string[] args) =>
1921
Host.CreateDefaultBuilder(args)
2022
.ConfigureWebHostDefaults(webBuilder =>

aspnetcore/tutorials/grpc/grpc-start/sample/GrpcGreeter/Services/GreeterService.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
using System.Linq;
44
using System.Threading.Tasks;
55
using Grpc.Core;
6+
using Microsoft.Extensions.Logging;
67

78
namespace GrpcGreeter
89
{
910
#region snippet
1011
public class GreeterService : Greeter.GreeterBase
1112
{
12-
public override Task<HelloReply> SayHello(
13-
HelloRequest request, ServerCallContext context)
13+
private readonly ILogger<GreeterService> _logger;
14+
public GreeterService(ILogger<GreeterService> logger)
15+
{
16+
_logger = logger;
17+
}
18+
19+
public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
1420
{
1521
return Task.FromResult(new HelloReply
1622
{

aspnetcore/tutorials/grpc/grpc-start/sample/GrpcGreeter/appsettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"Logging": {
33
"LogLevel": {
4-
"Default": "Warning",
4+
"Default": "Information",
5+
"Microsoft": "Warning",
56
"Microsoft.Hosting.Lifetime": "Information"
67
}
78
},

aspnetcore/tutorials/grpc/grpc-start/sample/GrpcGreeterClient/GrpcGreeterClient.csproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Google.Protobuf" Version="3.9.2" />
10-
<PackageReference Include="Grpc.Net.Client" Version="2.23.2" />
11-
<PackageReference Include="Grpc.Tools" Version="2.23.0" PrivateAssets="All" />
9+
<PackageReference Include="Google.Protobuf" Version="3.11.4" />
10+
<PackageReference Include="Grpc.Net.Client" Version="2.28.0" />
11+
<PackageReference Include="Grpc.Tools" Version="2.28.1">
12+
<PrivateAssets>all</PrivateAssets>
13+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
14+
</PackageReference>
1215
</ItemGroup>
1316

1417
<ItemGroup>

0 commit comments

Comments
 (0)