aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/csharp/Helloworld/README.md
blob: e6031794388328896fa49182ef5e305a9bf36405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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](https://www.nuget.org/packages/Grpc/)
and [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf/) NuGet packages
which have been already added to the project for you.

PREREQUISITES
-------------

- The [.NET Core SDK](https://www.microsoft.com/net/core) (version 2+ is recommended)

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#][]

[helloworld.proto]:../../protos/helloworld.proto
[gRPC Basics: C#]:https://grpc.io/docs/tutorials/basic/csharp.html