aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/csharp/helloworld-from-cli/README.md
blob: 4db077631d876b0344c4c8eedb56527aef099860 (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
52
53
54
55
56
57
58
59
gRPC in 3 minutes (C#)
========================

BACKGROUND
-------------
This is a different version of the helloworld example, using the dotnet sdk
tools to build and run.

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.

The examples in this directory target .NET 4.5 framework, as .NET Core support is
currently experimental.

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

- The DotNetCore SDK cli.

- The .NET 4.5 framework.

Both are available to download at https://www.microsoft.com/net/download

BUILD
-------

From the `examples/csharp/helloworld-from-cli` directory:

- `dotnet restore`

- `dotnet build **/project.json` (this will automatically download NuGet dependencies)

Try it!
-------

- Run the server

  ```
  > cd GreeterServer
  > dotnet run
  ```

- Run the client

  ```
  > cd GreeterClient
  > dotnet run
  ```

Tutorial
--------

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

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