Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

protoc generate grpc services c#

Solstice answered on August 10, 2023 Popularity 5/10 Helpfulness 6/10

Contents


More Related Answers

  • service in proto gRPC
  • protoc grpc-gateway protoc-gen-go protoc-gen-go-grpc protoc-gen-openapiv2 protoc-gen-grpc-gateway
  • Implementing the gRPC Client
  • go grpc protoc

  • protoc generate grpc services c#

    8

    Unlike messages, protoc does not natively support code autogen for services. To create stubs for services, the grpc C# plugin is required.


    First, install the Grpc.Tools NuGet package from inside Visual Studio.

    Then navigate to <NuGetPackageInstallDir>/GrpcTools.x.xx.x/tools/<yourOS>

    If you wish, the grpc_csharp_plugin.exe can be moved to a more permanent/accessible location


    Two additional commands are required for the plugin to work.

    To make protoc aware of the plugin, include this command when invoking protoc:


    An output for the files must also be specified like so:


    Users who opt to manually generate their message and service C# code stubs may opt to uninstall the GRPC.Tools NuGet package after completing these steps


    Additional examples and tips can be found here:

    https://groups.google.com/g/grpc-io/c/l6bZwTLbDb4/m/t7LtKHU_AgAJ

    https://stackoverflow.com/questions/50687335/how-to-use-the-grpc-tools-to-generate-code

    https://github.com/grpc/grpc/blob/master/src/csharp/BUILD-INTEGRATION.md#grpc_csharp_plugin-command-line-options

    Popularity 5/10 Helpfulness 6/10 Language shell
    Link to this answer
    Share Copy Link
    Contributed on Aug 10 2023
    Solstice
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.