grpc/examples/csharp/Helloworld
Jan Tattermusch a554a5cd70 regenerate protos for C# examples 2018-08-20 17:54:02 +02:00
..
Greeter regenerate protos for C# examples 2018-08-20 17:54:02 +02:00
GreeterClient make new-style .csproj helloworld the default 2018-07-26 12:59:07 +02:00
GreeterServer make new-style .csproj helloworld the default 2018-07-26 12:59:07 +02:00
Greeter.sln make new-style .csproj helloworld the default 2018-07-26 12:59:07 +02:00
README.md update the README files 2018-07-26 13:18:21 +02:00
generate_protos.bat upgrade dotnet examples to grpc1.14.1 and protobuf 3.6.1 2018-08-20 17:50:23 +02:00

README.md

gRPC in 3 minutes (C#)

BACKGROUND

For this sample, we've already generated the server and client stubs from helloworld.proto.

Example projects in this directory depend on the Grpc and Google.Protobuf NuGet packages which have been already added to the project for you.

PREREQUISITES

You can also build the example directly using Visual Studio 2017, but it's not a requirement.

BUILD

From the examples/csharp/Helloworld directory:

  • dotnet build Greeter.sln

(if you're using dotnet SDK 1.x you need to run dotnet restore Greeter.sln first)

Try it!

  • Run the server

    > cd GreeterServer
    > dotnet run -f netcoreapp1.0
    
  • Run the client

    > cd GreeterClient
    > dotnet run -f netcoreapp1.0
    

Tutorial

You can find a more detailed tutorial about Grpc in gRPC Basics: C#