Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame^] | 1 | gRPC in 3 minutes (C#) |
| 2 | ======================== |
| 3 | |
| 4 | BACKGROUND |
| 5 | ------------- |
| 6 | For this sample, we've already generated the server and client stubs from `helloworld.proto`. |
| 7 | Example projects depend on NuGet packages `Grpc` and `Google.ProtocolBuffers` which have been already added to the project for you. |
| 8 | |
| 9 | PREREQUISITES |
| 10 | ------------- |
| 11 | Windows |
| 12 | - .NET 4.5+ |
| 13 | - VS 2013 (with NuGet plugin installed) |
| 14 | |
| 15 | Linux (Mono) |
| 16 | - Mono installed |
| 17 | - Monodevelop 5.9 with NuGet Add-in installed (older versions might work) |
| 18 | |
| 19 | MacOS (Mono) |
| 20 | - TODO: MacOS support in progress |
| 21 | - Xamarin Studio (with NuGet plugin installed) |
| 22 | |
| 23 | BUILD |
| 24 | ------- |
| 25 | |
| 26 | Windows |
| 27 | - Clone this repository. |
| 28 | - Open solution `Greeter.sln` with Visual Studio |
| 29 | - Build the solution (this will automatically download NuGet dependencies) |
| 30 | |
| 31 | Linux (Mono) |
| 32 | - Clone this repository. |
| 33 | - Install gRPC C Core using instructions in https://github.com/grpc/homebrew-grpc |
| 34 | - TODO: explain using LD_LIBRARY_PATH or installation to /usr/local |
| 35 | - Open solution `Greeter.sln` in MonoDevelop (you need to manually restore dependencies by using `mono nuget.exe restore` if you don't have NuGet add-in) |
| 36 | - Build the solution. |
| 37 | |
| 38 | Try it! |
| 39 | ------- |
| 40 | |
| 41 | - Run the server |
| 42 | ``` |
| 43 | > cd GreeterServer/bin/Debug |
| 44 | > GreeterServer.exe |
| 45 | ``` |
| 46 | |
| 47 | - Run the client |
| 48 | ``` |
| 49 | > cd GreeterClient/bin/Debug |
| 50 | > GreeterClient.exe |
| 51 | ``` |
| 52 | |
| 53 | You can also run the server and client directly from Visual Studio. |
| 54 | |
| 55 | On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to run the server and client. |
| 56 | |
| 57 | Tutorial |
| 58 | -------- |
| 59 | |
| 60 | You can find a more detailed tutorial in [gRPC Basics: C#](https://github.com/grpc/grpc-common/blob/master/csharp/route_guide/README.md) |