blob: 77d1aaf2e660f2323dba982bc704db7e927fa564 [file] [log] [blame] [view]
Jan Tattermusch226af652015-04-03 16:39:51 -07001gRPC in 3 minutes (C#)
2========================
3
4BACKGROUND
5-------------
6For this sample, we've already generated the server and client stubs from `helloworld.proto`.
7Example projects depend on NuGet packages `Grpc` and `Google.ProtocolBuffers` which have been already added to the project for you.
8
9PREREQUISITES
10-------------
Jan Tattermusch2fca5452015-05-21 17:46:27 -070011**Windows**
Jan Tattermusch226af652015-04-03 16:39:51 -070012- .NET 4.5+
13- VS 2013 (with NuGet plugin installed)
14
Jan Tattermusch2fca5452015-05-21 17:46:27 -070015**Linux (Mono)**
16- Mono
Jan Tattermusch226af652015-04-03 16:39:51 -070017- Monodevelop 5.9 with NuGet Add-in installed (older versions might work)
18
Jan Tattermusch2fca5452015-05-21 17:46:27 -070019**MacOS (Mono)**
Jan Tattermusch226af652015-04-03 16:39:51 -070020- Xamarin Studio (with NuGet plugin installed)
21
22BUILD
23-------
24
Jan Tattermusch2fca5452015-05-21 17:46:27 -070025**Windows**
Jan Tattermusch226af652015-04-03 16:39:51 -070026- Clone this repository.
Jan Tattermusch2fca5452015-05-21 17:46:27 -070027
Jan Tattermusch226af652015-04-03 16:39:51 -070028- Open solution `Greeter.sln` with Visual Studio
Jan Tattermusch2fca5452015-05-21 17:46:27 -070029
Jan Tattermusch226af652015-04-03 16:39:51 -070030- Build the solution (this will automatically download NuGet dependencies)
31
Jan Tattermusch2fca5452015-05-21 17:46:27 -070032**Linux (Mono)**
Jan Tattermusch226af652015-04-03 16:39:51 -070033- Clone this repository.
Jan Tattermusch2fca5452015-05-21 17:46:27 -070034
Jan Tattermusch226af652015-04-03 16:39:51 -070035- Install gRPC C Core using instructions in https://github.com/grpc/homebrew-grpc
Jan Tattermusch2fca5452015-05-21 17:46:27 -070036
37- gRPC C# depends on native shared library `libgrpc_csharp_ext.so`. To make it visible
38 to Mono runtime, follow instructions in [Using gRPC C# on Linux](https://github.com/grpc/grpc/tree/master/src/csharp#usage-linux-mono)
39
Jan Tattermusch226af652015-04-03 16:39:51 -070040- 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)
Jan Tattermusch2fca5452015-05-21 17:46:27 -070041
Jan Tattermusch226af652015-04-03 16:39:51 -070042- Build the solution.
43
Jan Tattermusch2fca5452015-05-21 17:46:27 -070044**MacOS (Mono)**
45- See [Using gRPC C# on MacOS](https://github.com/grpc/grpc/tree/master/src/csharp#usage-macos-mono) for more info
46 on MacOS support.
47
Jan Tattermusch226af652015-04-03 16:39:51 -070048Try it!
49-------
50
51- Run the server
Jan Tattermusch2fca5452015-05-21 17:46:27 -070052
53 ```
54 > cd GreeterServer/bin/Debug
55 > GreeterServer.exe
56 ```
Jan Tattermusch226af652015-04-03 16:39:51 -070057
58- Run the client
Jan Tattermusch2fca5452015-05-21 17:46:27 -070059
60 ```
61 > cd GreeterClient/bin/Debug
62 > GreeterClient.exe
63 ```
Jan Tattermusch226af652015-04-03 16:39:51 -070064
65You can also run the server and client directly from Visual Studio.
66
67On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to run the server and client.
68
69Tutorial
70--------
71
72You can find a more detailed tutorial in [gRPC Basics: C#](https://github.com/grpc/grpc-common/blob/master/csharp/route_guide/README.md)