【问题标题】:gRPC not generating *grpc.csgRPC 不生成 *grpc.cs
【发布时间】:2017-05-05 18:35:12
【问题描述】:

我正在尝试使用 .bat 文件生成 grpc .cs 文件,但没有生成 messageGRPC.cs 文件。但是,message.g.cs 确实被创建了。没有错误,我什至尝试对路径进行硬编码并在管理员模式下运行命令窗口,结果相同。

message.g.cs 再次正确生成,但 messageGRPC.cs 没有。

在我的项目中,我安装了 Google.Protobuf、Google.Protobuf.Tools、Grpc、 来自 NuGet 的 Grpc.Core 和 Grpc.Tools。

是不是我做错了什么?

@echo off
cd %~dp0

:: Display Current Working Directory used for debugging
:: echo Current Directory = %CD%

set PROJ_ROOT=%CD%        
set ROOT_DIR=%CD%

:: Display Solution Root Directory used for debugging
:: echo Root Directory = %ROOT_DIR%

:: Set path variables
set SRC_DIR=%ROOT_DIR%\Common\Messages

set PLUGIN_DIR=%ROOT_DIR%\<project>\packages\Grpc.Tools.1.3.0\tools\windows_x64

set DST_DIR=%ROOT_DIR%\Common\Messages\proto3

:: debugging
echo plug_in_dir = "%PLUGIN_DIR%"

echo Started compiling .proto messages using protoc version
"%PLUGIN_DIR%"\protoc.exe --version

:: code is on one line. it's wrapped here for readability
"%PLUGIN_DIR%"\protoc.exe -I "%SRC_DIR%" --proto_path="%SRC_DIR%" 
 --csharp_opt=file_extension=.g.cs --csharp_out="%DST_DIR%" "%SRC_DIR%"\message.proto 
 --grpc_out="%PROJ_ROOT%"\gRPC 
 --plugin=protoc-gen-grpc="%PLUGIN_DIR%"\grpc_csharp_plugin.exe  

cd %PROJ_ROOT%

echo Completed compiling .proto messages

【问题讨论】:

    标签: c# protocol-buffers grpc proto protoc


    【解决方案1】:

    这里回答了同样的问题: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/grpc-io/l6bZwTLbDb4/bYRBmx37AgAJ

    请尽量避免重复发布相同的问题(我们正在监控 stackoverflow 和 grpc.io 邮件列表,重复发布只会增加管理负担,不会使问题更有可能得到回答)。

    【讨论】:

    • 对不起,我不知道你也在监控stackoverflow
    猜你喜欢
    • 1970-01-01
    • 2015-10-27
    • 1970-01-01
    • 1970-01-01
    • 2016-09-19
    • 2019-12-25
    • 2017-09-07
    • 1970-01-01
    • 2021-06-09
    相关资源
    最近更新 更多