Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 1 | gRPC in 3 minutes (C#) |
| 2 | ======================== |
| 3 | |
| 4 | BACKGROUND |
| 5 | ------------- |
Jan Tattermusch | 3fcbdef | 2015-09-25 11:53:16 -0700 | [diff] [blame] | 6 | For this sample, we've already generated the server and client stubs from [helloworld.proto][]. |
| 7 | |
| 8 | Example projects depend on the [Grpc](https://www.nuget.org/packages/Grpc/) |
| 9 | and [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf/) NuGet packages |
| 10 | which have been already added to the project for you. |
Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 11 | |
| 12 | PREREQUISITES |
| 13 | ------------- |
Jan Tattermusch | 2fca545 | 2015-05-21 17:46:27 -0700 | [diff] [blame] | 14 | **Windows** |
Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 15 | - .NET 4.5+ |
Jan Tattermusch | 3fcbdef | 2015-09-25 11:53:16 -0700 | [diff] [blame] | 16 | - Visual Studio 2013 or 2015 |
Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 17 | |
Jan Tattermusch | 3fcbdef | 2015-09-25 11:53:16 -0700 | [diff] [blame] | 18 | **Linux** |
Jan Tattermusch | 7492c7c | 2016-02-12 15:25:45 -0800 | [diff] [blame] | 19 | - Mono 4.0+ |
| 20 | - Monodevelop 5.9+ (with NuGet plugin installed) |
Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 21 | |
Jan Tattermusch | 3fcbdef | 2015-09-25 11:53:16 -0700 | [diff] [blame] | 22 | **Mac OS X** |
Jan Tattermusch | 7492c7c | 2016-02-12 15:25:45 -0800 | [diff] [blame] | 23 | - Xamarin Studio 5.9+ |
Jan Tattermusch | 3fcbdef | 2015-09-25 11:53:16 -0700 | [diff] [blame] | 24 | - [homebrew][] |
Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 25 | |
| 26 | BUILD |
| 27 | ------- |
| 28 | |
Jan Tattermusch | 7492c7c | 2016-02-12 15:25:45 -0800 | [diff] [blame] | 29 | - Open solution `Greeter.sln` with Visual Studio, Monodevelop (on Linux) or Xamarin Studio (on Mac OS X) |
Jan Tattermusch | 3fcbdef | 2015-09-25 11:53:16 -0700 | [diff] [blame] | 30 | |
| 31 | - Build the solution (this will automatically download NuGet dependencies) |
| 32 | |
| 33 | Try it! |
Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 34 | ------- |
| 35 | |
| 36 | - Run the server |
Jan Tattermusch | 2fca545 | 2015-05-21 17:46:27 -0700 | [diff] [blame] | 37 | |
| 38 | ``` |
| 39 | > cd GreeterServer/bin/Debug |
| 40 | > GreeterServer.exe |
| 41 | ``` |
Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 42 | |
| 43 | - Run the client |
Jan Tattermusch | 2fca545 | 2015-05-21 17:46:27 -0700 | [diff] [blame] | 44 | |
| 45 | ``` |
| 46 | > cd GreeterClient/bin/Debug |
| 47 | > GreeterClient.exe |
| 48 | ``` |
Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 49 | |
Jan Tattermusch | 7492c7c | 2016-02-12 15:25:45 -0800 | [diff] [blame] | 50 | You can also run the server and client directly from the IDE. |
Jan Tattermusch | 226af65 | 2015-04-03 16:39:51 -0700 | [diff] [blame] | 51 | |
| 52 | On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to run the server and client. |
| 53 | |
| 54 | Tutorial |
| 55 | -------- |
| 56 | |
Jan Tattermusch | 3fcbdef | 2015-09-25 11:53:16 -0700 | [diff] [blame] | 57 | You can find a more detailed tutorial in [gRPC Basics: C#][] |
| 58 | |
| 59 | [homebrew]:http://brew.sh |
| 60 | [helloworld.proto]:../../protos/helloworld.proto |
Jan Tattermusch | 3fcbdef | 2015-09-25 11:53:16 -0700 | [diff] [blame] | 61 | [gRPC Basics: C#]:http://www.grpc.io/docs/tutorials/basic/csharp.html |