• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1gRPC in 3 minutes (C#)
2========================
3
4BACKGROUND
5-------------
6This is a different version of the helloworld example, using the "classic" .csproj
7files, the only format supported by VS2013 (and older versions of mono).
8You can still use gRPC with the classic .csproj files, but [using the new-style
9.csproj projects](../Helloworld/README.md) (supported by VS2017 v15.3 and above,
10and dotnet SDK) is recommended.
11
12Example projects depend on the [Grpc](https://www.nuget.org/packages/Grpc/),
13[Grpc.Tools](https://www.nuget.org/packages/Grpc.Tools/)
14and [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf/) NuGet packages
15which have been already added to the project for you.
16
17PREREQUISITES
18-------------
19
20- Windows: .NET Framework 4.5+, Visual Studio 2013 or higher
21- Linux: Mono 4+, MonoDevelop 5.9+
22- Mac OS X: Xamarin Studio 5.9+
23
24BUILD
25-------
26
27- Open solution `Greeter.sln` with Visual Studio, Monodevelop (on Linux) or Xamarin Studio (on Mac OS X)
28
29# Using Visual Studio
30
31* Select "Restore NuGet Packages" from the solution context menu. It is recommended
32  to close and re-open the solution after the packages have been restored from
33  Visual Studio.
34* Build the solution.
35
36# Using Monodevelop or Xamarin Studio
37
38The NuGet add-in available for Xamarin Studio and Monodevelop IDEs is too old to
39download all of the NuGet dependencies of gRPC.
40
41Using these IDEs, a workaround is as follows:
42* Obtain a nuget executable for your platform and update it with
43 `nuget update -self`.
44* Navigate to this directory and run `nuget restore`.
45* Now that packages have been restored into their proper package folder, build the solution from your IDE.
46
47Try it!
48-------
49
50- Run the server
51
52  ```
53  > cd GreeterServer/bin/Debug
54  > GreeterServer.exe
55  ```
56
57- Run the client
58
59  ```
60  > cd GreeterClient/bin/Debug
61  > GreeterClient.exe
62  ```
63
64You can also run the server and client directly from the IDE.
65
66On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to run the server and client.
67
68Tutorial
69--------
70
71You can find a more detailed tutorial in [gRPC Basics: C#][]
72
73[helloworld.proto]:../../protos/helloworld.proto
74[gRPC Basics: C#]:https://grpc.io/docs/languages/csharp/basics
75