• Home
Name Date Size #Lines LOC

..--

Grpc.Auth/03-May-2024-234118

Grpc.Core/03-May-2024-15,4399,078

Grpc.Core.Testing/03-May-2024-220124

Grpc.Core.Tests/03-May-2024-5,6704,093

Grpc.Examples/03-May-2024-1,359987

Grpc.Examples.MathClient/03-May-2024-10659

Grpc.Examples.MathServer/03-May-2024-10862

Grpc.Examples.Tests/03-May-2024-444294

Grpc.HealthCheck/03-May-2024-631451

Grpc.HealthCheck.Tests/03-May-2024-287176

Grpc.IntegrationTesting/03-May-2024-17,91114,001

Grpc.IntegrationTesting.Client/03-May-2024-9449

Grpc.IntegrationTesting.QpsWorker/03-May-2024-9550

Grpc.IntegrationTesting.Server/03-May-2024-9348

Grpc.IntegrationTesting.StressClient/03-May-2024-9348

Grpc.Microbenchmarks/03-May-2024-523364

Grpc.Reflection/03-May-2024-2,1941,716

Grpc.Reflection.Tests/03-May-2024-301197

doc/03-May-2024-5549

experimental/03-May-2024-18579

ext/03-May-2024-1,146900

keys/03-May-2024-98

unitypackage/03-May-2024-1,6331,588

.editorconfigD03-May-2024148 98

.gitignoreD03-May-2024176 1816

Grpc.Core.NativeDebug.nuspecD03-May-20241.3 KiB2624

Grpc.Tools.nuspecD03-May-20242.2 KiB3432

Grpc.nuspecD03-May-2024900 2322

Grpc.slnD03-May-20249.5 KiB125123

README.mdD03-May-20244 KiB10771

Settings.StyleCopD03-May-202419.2 KiB509509

build_packages_dotnetcli.batD03-May-20242.5 KiB5945

build_unitypackage.batD03-May-20244.8 KiB8164

generate_proto_csharp.shD03-May-20242 KiB4619

tests.jsonD03-May-20242.6 KiB6766

README.md

1[![Nuget](https://img.shields.io/nuget/v/Grpc.svg)](http://www.nuget.org/packages/Grpc/)
2gRPC C#
3=======
4
5A C# implementation of gRPC.
6
7SUPPORTED PLATFORMS
8------------------
9
10- [.NET Core](https://dotnet.github.io/) on Linux, Windows and Mac OS X
11- .NET Framework 4.5+ (Windows)
12- Mono 4+ on Linux, Windows and Mac OS X
13
14PREREQUISITES
15--------------
16
17When using gRPC C# under .NET Core you only need to [install .NET Core](https://www.microsoft.com/net/core).
18
19In addition to that, you can also use gRPC C# with these runtimes / IDEs
20- Windows: .NET Framework 4.5+, Visual Studio 2013, 2015, 2017, Visual Studio Code
21- Linux: Mono 4+, Visual Studio Code, MonoDevelop 5.9+
22- Mac OS X: Mono 4+, Visual Studio Code, Xamarin Studio 5.9+
23
24HOW TO USE
25--------------
26
27**Windows, Linux, Mac OS X**
28
29- Open Visual Studio / MonoDevelop / Xamarin Studio and start a new project/solution (alternatively, you can create a new project from command line with `dotnet` SDK)
30
31- Add the [Grpc](https://www.nuget.org/packages/Grpc/) NuGet package as a dependency (Project options -> Manage NuGet Packages).
32
33- To be able to generate code from Protocol Buffer (`.proto`) file definitions, add the [Grpc.Tools](https://www.nuget.org/packages/Grpc.Tools/) NuGet package that contains Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin.
34
35**Xamarin.Android and Xamarin.iOS (Experimental only)**
36
37See [Experimentally supported platforms](experimental) for instructions.
38
39**Unity (Experimental only)**
40
41See [Experimentally supported platforms](experimental) for instructions.
42
43BUILD FROM SOURCE
44-----------------
45
46You only need to go through these steps if you are planning to develop gRPC C#.
47If you are a user of gRPC C#, go to Usage section above.
48
49**Prerequisites for contributors**
50
51- [dotnet SDK](https://www.microsoft.com/net/core)
52- [Mono 4+](https://www.mono-project.com/) (only needed for Linux and MacOS)
53- Prerequisites mentioned in [BUILDING.md](../../BUILDING.md#pre-requisites)
54  to be able to compile the native code.
55
56**Windows, Linux or Mac OS X**
57
58- The easiest way to build is using the `run_tests.py` script that will take care of building the `grpc_csharp_ext` native library.
59
60  ```
61  # NOTE: make sure all necessary git submodules with dependencies
62  # are available by running "git submodule update --init"
63
64  # from the gRPC repository root
65  $ python tools/run_tests/run_tests.py -l csharp -c dbg --build_only
66  ```
67
68- Use Visual Studio 2017 (on Windows) to open the solution `Grpc.sln` or use Visual Studio Code with C# extension (on Linux and Mac). gRPC C# code has been migrated to
69  dotnet SDK `.csproj` projects that are much simpler to maintain, but are not yet supported by Xamarin Studio or Monodevelop (the NuGet packages still
70  support both `net45` and `netstandard` and can be used in all IDEs).
71
72RUNNING TESTS
73-------------
74
75gRPC C# is using NUnit as the testing framework.
76
77Under Visual Studio, make sure NUnit test adapter is installed (under "Extensions and Updates").
78Then you should be able to run all the tests using Test Explorer.
79
80gRPC team uses a Python script to facilitate running tests for
81different languages.
82
83```
84# from the gRPC repository root
85$ python tools/run_tests/run_tests.py -l csharp -c dbg
86```
87
88DOCUMENTATION
89-------------
90- [API Reference][]
91- [Helloworld Example][]
92- [RouteGuide Tutorial][]
93
94PERFORMANCE
95-----------
96
97For best gRPC C# performance, use [.NET Core](https://dotnet.github.io/) and the Server GC mode `"System.GC.Server": true` for your applications.
98
99THE NATIVE DEPENDENCY
100---------------
101
102Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. The fact that a native library is used should be fully transparent to the users and just installing the `Grpc.Core` NuGet package is the only step needed to use gRPC C# on all supported platforms.
103
104[API Reference]: https://grpc.io/grpc/csharp/api/Grpc.Core.html
105[Helloworld Example]: ../../examples/csharp/helloworld
106[RouteGuide Tutorial]: https://grpc.io/docs/tutorials/basic/csharp.html
107