OLD | NEW |
(Empty) | |
| 1 [](http://www.nuget.org/package
s/Grpc/) |
| 2 gRPC C# |
| 3 ======= |
| 4 |
| 5 A C# implementation of gRPC. |
| 6 |
| 7 Status |
| 8 ------ |
| 9 |
| 10 Beta |
| 11 |
| 12 PREREQUISITES |
| 13 -------------- |
| 14 |
| 15 - Windows: .NET Framework 4.5+, Visual Studio 2013 or 2015 |
| 16 - Linux: Mono 4+, MonoDevelop 5.9+ (with NuGet add-in installed) |
| 17 - Mac OS X: Xamarin Studio 5.9+ |
| 18 |
| 19 HOW TO USE |
| 20 -------------- |
| 21 |
| 22 **Windows** |
| 23 |
| 24 - Open Visual Studio and start a new project/solution. |
| 25 |
| 26 - Add NuGet package `Grpc` as a dependency (Project options -> Manage NuGet Pack
ages). |
| 27 That will also pull all the transitive dependencies (including the gRPC native
library that |
| 28 gRPC C# is using internally). |
| 29 |
| 30 **Linux (Debian)** |
| 31 |
| 32 - Open MonoDevelop and start a new project/solution. |
| 33 |
| 34 - Add NuGet package `Grpc` as a dependency (Project -> Add NuGet packages). |
| 35 That will also pull all the transitive dependencies (including the gRPC native
library that |
| 36 gRPC C# is using internally). |
| 37 |
| 38 - NOTE: gRPC C# doesn't have a good story yet for shipping precompiled Linux ver
sion of Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin. You c
an install them using [gRPC Linuxbrew instructions][]. |
| 39 |
| 40 **Mac OS X** |
| 41 |
| 42 - Open Xamarin Studio and start a new project/solution. |
| 43 |
| 44 - Add NuGet package `Grpc` as a dependency (Project -> Add NuGet packages). |
| 45 That will also pull all the transitive dependencies (including the gRPC native
library that |
| 46 gRPC C# is using internally). |
| 47 |
| 48 - NOTE: gRPC C# doesn't have a good story yet for shipping precompiled Mac OS X
version of Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin. Yo
u can install them using [gRPC Homebrew instructions][]. |
| 49 |
| 50 BUILD FROM SOURCE |
| 51 ----------------- |
| 52 |
| 53 You only need to go through these steps if you are planning to develop gRPC C#. |
| 54 If you are a user of gRPC C#, go to Usage section above. |
| 55 |
| 56 **Windows** |
| 57 |
| 58 - The grpc_csharp_ext native library needs to be built so you can build the gRPC
C# solution. You can |
| 59 either build the native solution in `vsprojects/grpc_csharp_ext.sln` from Visu
al Studio manually, or you can use |
| 60 a convenience batch script that builds everything for you. |
| 61 |
| 62 ``` |
| 63 > REM From src/csharp directory |
| 64 > buildall.bat |
| 65 ``` |
| 66 |
| 67 - Open Grpc.sln using Visual Studio. |
| 68 |
| 69 **Linux** |
| 70 |
| 71 - The grpc_csharp_ext native library needs to be built so you can build the gRPC
C# solution: |
| 72 ```sh |
| 73 # from the gRPC repository root |
| 74 $ make CONFIG=dbg grpc_csharp_ext |
| 75 ``` |
| 76 |
| 77 - Use MonoDevelop to open the solution Grpc.sln |
| 78 |
| 79 **Mac OS X** |
| 80 |
| 81 - The grpc_csharp_ext native library needs to be built so you can build the gRPC
C# solution. |
| 82 |
| 83 ```sh |
| 84 # from the gRPC repository root |
| 85 $ tools/run_tests/run_tests.py -c dbg -l csharp --build_only |
| 86 ``` |
| 87 |
| 88 - Use Xamarin Studio to open the solution Grpc.sln |
| 89 |
| 90 RUNNING TESTS |
| 91 ------------- |
| 92 |
| 93 gRPC C# is using NUnit as the testing framework. |
| 94 |
| 95 Under Visual Studio, make sure NUnit test adapter is installed (under "Extension
s and Updates"). |
| 96 Then you should be able to run all the tests using Test Explorer. |
| 97 |
| 98 Under Monodevelop or Xamarin Studio, make sure you installed "NUnit support" in
Add-in manager. |
| 99 Then you should be able to run all the test from the Test View. |
| 100 |
| 101 gRPC team uses a Python script to simplify facilitate running tests for |
| 102 different languages. |
| 103 |
| 104 ``` |
| 105 tools/run_tests/run_tests.py -l csharp |
| 106 ``` |
| 107 |
| 108 DOCUMENTATION |
| 109 ------------- |
| 110 - the gRPC C# reference documentation is available online at [grpc.io][] |
| 111 - [Helloworld example][] |
| 112 |
| 113 CONTENTS |
| 114 -------- |
| 115 |
| 116 - ext: |
| 117 The extension library that wraps C API to be more digestible by C#. |
| 118 - Grpc.Auth: |
| 119 gRPC OAuth2 support. |
| 120 - Grpc.Core: |
| 121 The main gRPC C# library. |
| 122 - Grpc.Examples: |
| 123 API examples for math.proto |
| 124 - Grpc.Examples.MathClient: |
| 125 An example client that sends some requests to math server. |
| 126 - Grpc.Examples.MathServer: |
| 127 An example client that sends some requests to math server. |
| 128 - Grpc.IntegrationTesting: |
| 129 Cross-language gRPC implementation testing (interop testing). |
| 130 |
| 131 THE NATIVE DEPENDENCY |
| 132 --------------- |
| 133 |
| 134 Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes
its functionality via P/Invoke. `grpc_csharp_ext` library is a native extension
library that facilitates this by wrapping some C core API into a form that's mo
re digestible for P/Invoke. |
| 135 |
| 136 Prior to version 0.13, installing `grpc_csharp_ext` was required to make gRPC wo
rk on Linux and MacOS. Starting with version 0.13, we have improved the packagin
g story significantly and precompiled versions of the native library for all sup
ported platforms are now shipped with the NuGet package. Just installing the `Gr
pc` NuGet package should be the only step needed to use gRPC C#, regardless of y
our platform (Windows, Linux or Mac) and the bitness (32 or 64bit). |
| 137 |
| 138 [gRPC Linuxbrew instructions]:https://github.com/grpc/homebrew-grpc#quick-instal
l-linux |
| 139 [gRPC Homebrew instructions]:https://github.com/grpc/homebrew-grpc#quick-install
-linux |
| 140 [homebrew]:http://brew.sh |
| 141 [gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/maste
r/scripts/install |
| 142 [grpc.io]: http://www.grpc.io/docs/installation/csharp.html |
| 143 [Debian jessie-backports]:http://backports.debian.org/Instructions/ |
| 144 [Helloworld example]:../../examples/csharp/helloworld |
OLD | NEW |