File tree Expand file tree Collapse file tree 6 files changed +27
-15
lines changed
aspnetcore/tutorials/grpc Expand file tree Collapse file tree 6 files changed +27
-15
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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 =>
Original file line number Diff line number Diff line change 33using System . Linq ;
44using System . Threading . Tasks ;
55using Grpc . Core ;
6+ using Microsoft . Extensions . Logging ;
67
78namespace 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 {
Original file line number Diff line number Diff line change 11{
22 "Logging" : {
33 "LogLevel" : {
4- "Default" : " Warning" ,
4+ "Default" : " Information" ,
5+ "Microsoft" : " Warning" ,
56 "Microsoft.Hosting.Lifetime" : " Information"
67 }
78 },
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments