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.
68 lines
1.9 KiB
68 lines
1.9 KiB
10 years ago
|
gRPC in 3 minutes (C#)
|
||
|
========================
|
||
|
|
||
|
BACKGROUND
|
||
|
-------------
|
||
9 years ago
|
For this sample, we've already generated the server and client stubs from [helloworld.proto][].
|
||
|
|
||
9 years ago
|
Example projects depend on the [Grpc](https://www.nuget.org/packages/Grpc/), [Grpc.Tools](https://www.nuget.org/packages/Grpc.Tools/)
|
||
9 years ago
|
and [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf/) NuGet packages
|
||
|
which have been already added to the project for you.
|
||
10 years ago
|
|
||
|
PREREQUISITES
|
||
|
-------------
|
||
|
|
||
9 years ago
|
- Windows: .NET Framework 4.5+, Visual Studio 2013 or 2015
|
||
8 years ago
|
- Linux: Mono 4+, MonoDevelop 5.9+
|
||
9 years ago
|
- Mac OS X: Xamarin Studio 5.9+
|
||
10 years ago
|
|
||
|
BUILD
|
||
|
-------
|
||
|
|
||
9 years ago
|
- Open solution `Greeter.sln` with Visual Studio, Monodevelop (on Linux) or Xamarin Studio (on Mac OS X)
|
||
10 years ago
|
|
||
8 years ago
|
# Using Visual Studio
|
||
|
|
||
|
* Build the solution (this will automatically download NuGet dependencies)
|
||
|
|
||
|
# Using Monodevelop or Xamarin Studio
|
||
|
|
||
|
The nuget add-in available for Xamarin Studio and Monodevelop IDEs is too old to
|
||
|
download all of the nuget dependencies of gRPC. One alternative to is to use the dotnet command line tools instead (see [helloworld-from-cli]).
|
||
|
|
||
|
Using these IDEs, a workaround is as follows:
|
||
|
* Obtain a nuget executable for your platform and update it with
|
||
|
`nuget update -self`.
|
||
|
* Navigate to this directory and run `nuget restore`.
|
||
|
* Now that packages have been restored into their proper package folder, build the solution from your IDE.
|
||
9 years ago
|
|
||
|
Try it!
|
||
10 years ago
|
-------
|
||
|
|
||
|
- 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
|
|
||
9 years ago
|
You can also run the server and client directly from the IDE.
|
||
10 years ago
|
|
||
|
On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to run the server and client.
|
||
|
|
||
|
Tutorial
|
||
|
--------
|
||
|
|
||
9 years ago
|
You can find a more detailed tutorial in [gRPC Basics: C#][]
|
||
|
|
||
8 years ago
|
[helloworld-from-cli]:../helloworld-from-cli/README.md
|
||
9 years ago
|
[helloworld.proto]:../../protos/helloworld.proto
|
||
7 years ago
|
[gRPC Basics: C#]:https://grpc.io/docs/tutorials/basic/csharp.html
|