mirror of https://github.com/grpc/grpc.git
The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
https://grpc.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.9 KiB
73 lines
1.9 KiB
10 years ago
|
gRPC in 3 minutes (C#)
|
||
|
========================
|
||
|
|
||
|
BACKGROUND
|
||
|
-------------
|
||
|
For this sample, we've already generated the server and client stubs from `helloworld.proto`.
|
||
|
Example projects depend on NuGet packages `Grpc` and `Google.ProtocolBuffers` which have been already added to the project for you.
|
||
|
|
||
|
PREREQUISITES
|
||
|
-------------
|
||
10 years ago
|
**Windows**
|
||
10 years ago
|
- .NET 4.5+
|
||
|
- VS 2013 (with NuGet plugin installed)
|
||
|
|
||
10 years ago
|
**Linux (Mono)**
|
||
|
- Mono
|
||
10 years ago
|
- Monodevelop 5.9 with NuGet Add-in installed (older versions might work)
|
||
|
|
||
10 years ago
|
**MacOS (Mono)**
|
||
10 years ago
|
- Xamarin Studio (with NuGet plugin installed)
|
||
|
|
||
|
BUILD
|
||
|
-------
|
||
|
|
||
10 years ago
|
**Windows**
|
||
10 years ago
|
- Clone this repository.
|
||
10 years ago
|
|
||
10 years ago
|
- Open solution `Greeter.sln` with Visual Studio
|
||
10 years ago
|
|
||
10 years ago
|
- Build the solution (this will automatically download NuGet dependencies)
|
||
|
|
||
10 years ago
|
**Linux (Mono)**
|
||
10 years ago
|
- Clone this repository.
|
||
10 years ago
|
|
||
10 years ago
|
- Install gRPC C Core using instructions in https://github.com/grpc/homebrew-grpc
|
||
10 years ago
|
|
||
|
- gRPC C# depends on native shared library `libgrpc_csharp_ext.so`. To make it visible
|
||
|
to Mono runtime, follow instructions in [Using gRPC C# on Linux](https://github.com/grpc/grpc/tree/master/src/csharp#usage-linux-mono)
|
||
|
|
||
10 years ago
|
- 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)
|
||
10 years ago
|
|
||
10 years ago
|
- Build the solution.
|
||
|
|
||
10 years ago
|
**MacOS (Mono)**
|
||
|
- See [Using gRPC C# on MacOS](https://github.com/grpc/grpc/tree/master/src/csharp#usage-macos-mono) for more info
|
||
|
on MacOS support.
|
||
|
|
||
10 years ago
|
Try it!
|
||
|
-------
|
||
|
|
||
|
- Run the server
|
||
10 years ago
|
|
||
|
```
|
||
|
> cd GreeterServer/bin/Debug
|
||
|
> GreeterServer.exe
|
||
|
```
|
||
10 years ago
|
|
||
|
- Run the client
|
||
10 years ago
|
|
||
|
```
|
||
|
> cd GreeterClient/bin/Debug
|
||
|
> GreeterClient.exe
|
||
|
```
|
||
10 years ago
|
|
||
|
You can also run the server and client directly from Visual Studio.
|
||
|
|
||
|
On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to run the server and client.
|
||
|
|
||
|
Tutorial
|
||
|
--------
|
||
|
|
||
|
You can find a more detailed tutorial in [gRPC Basics: C#](https://github.com/grpc/grpc-common/blob/master/csharp/route_guide/README.md)
|