Coder Social home page Coder Social logo

gbfdata's Introduction

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 the Grpc, Grpc.Tools and Google.Protobuf NuGet packages which have been already added to the project for you.

PREREQUISITES

  • Windows: .NET Framework 4.5+, Visual Studio 2013 or 2015
  • Linux: Mono 4+, MonoDevelop 5.9+
  • Mac OS X: Xamarin Studio 5.9+

BUILD

  • Open solution Greeter.sln with Visual Studio, Monodevelop (on Linux) or Xamarin Studio (on Mac OS X)

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.

Try it!

  • Run the server

    > cd GreeterServer/bin/Debug
    > GreeterServer.exe
    
  • Run the client

    > cd GreeterClient/bin/Debug
    > GreeterClient.exe
    

You can also run the server and client directly from the IDE.

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#

gbfdata's People

Contributors

haoyu214 avatar shdamon avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

shdamon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.