blob: f1af1f6793c0585ddf1e5c533f52fe0f75c19c7a [file] [log] [blame] [view]
Jan Tattermusch226af652015-04-03 16:39:51 -07001gRPC in 3 minutes (C#)
2========================
3
4BACKGROUND
5-------------
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -07006For this sample, we've already generated the server and client stubs from [helloworld.proto][].
7
8Example projects depend on the [Grpc](https://www.nuget.org/packages/Grpc/)
9and [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf/) NuGet packages
10which have been already added to the project for you.
Jan Tattermusch226af652015-04-03 16:39:51 -070011
12PREREQUISITES
13-------------
Jan Tattermusch2fca5452015-05-21 17:46:27 -070014**Windows**
Jan Tattermusch226af652015-04-03 16:39:51 -070015- .NET 4.5+
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070016- Visual Studio 2013 or 2015
Jan Tattermusch226af652015-04-03 16:39:51 -070017
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070018**Linux**
Jan Tattermusch2fca5452015-05-21 17:46:27 -070019- Mono
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070020- Monodevelop 5.9 with NuGet Add-in installed
Jan Tattermusch226af652015-04-03 16:39:51 -070021
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070022**Mac OS X**
Jan Tattermusch226af652015-04-03 16:39:51 -070023- Xamarin Studio (with NuGet plugin installed)
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070024- [homebrew][]
Jan Tattermusch226af652015-04-03 16:39:51 -070025
26BUILD
27-------
28
Jan Tattermusch2fca5452015-05-21 17:46:27 -070029**Windows**
Jan Tattermusch2fca5452015-05-21 17:46:27 -070030
Jan Tattermusch226af652015-04-03 16:39:51 -070031- Open solution `Greeter.sln` with Visual Studio
Jan Tattermusch2fca5452015-05-21 17:46:27 -070032
Jan Tattermusch226af652015-04-03 16:39:51 -070033- Build the solution (this will automatically download NuGet dependencies)
34
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070035**Linux (Debian)**
Jan Tattermusch2fca5452015-05-21 17:46:27 -070036
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070037- Install gRPC C core and C# native extension using [How to use gRPC C#][] instructions
Jan Tattermusch2fca5452015-05-21 17:46:27 -070038
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070039- Open solution `Greeter.sln` in MonoDevelop.
Jan Tattermusch2fca5452015-05-21 17:46:27 -070040
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070041- Build the solution (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 -070042
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070043**Mac OS X**
Jan Tattermusch226af652015-04-03 16:39:51 -070044
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070045- Install gRPC C core and C# native extension using [How to use gRPC C#][] instructions
Jan Tattermusch2fca5452015-05-21 17:46:27 -070046
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070047- Open solution `Greeter.sln` with Xamarin Studio
48
49- Build the solution (this will automatically download NuGet dependencies)
50
51Try it!
Jan Tattermusch226af652015-04-03 16:39:51 -070052-------
53
54- Run the server
Jan Tattermusch2fca5452015-05-21 17:46:27 -070055
56 ```
57 > cd GreeterServer/bin/Debug
58 > GreeterServer.exe
59 ```
Jan Tattermusch226af652015-04-03 16:39:51 -070060
61- Run the client
Jan Tattermusch2fca5452015-05-21 17:46:27 -070062
63 ```
64 > cd GreeterClient/bin/Debug
65 > GreeterClient.exe
66 ```
Jan Tattermusch226af652015-04-03 16:39:51 -070067
68You can also run the server and client directly from Visual Studio.
69
70On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to run the server and client.
71
72Tutorial
73--------
74
Jan Tattermusch3fcbdef2015-09-25 11:53:16 -070075You can find a more detailed tutorial in [gRPC Basics: C#][]
76
77[homebrew]:http://brew.sh
78[helloworld.proto]:../../protos/helloworld.proto
79[How to use gRPC C#]:../../../src/csharp#how-to-use
80[gRPC Basics: C#]:http://www.grpc.io/docs/tutorials/basic/csharp.html