我试图使用一个.cs文件生成grpc .cs文件,但是messageGRPC.cs文件没有生成。但是,message.g.cs确实会被创建。没有错误,我甚至尝试在管理员模式下对路径进行编码并运行命令窗口,结果也是一样的。
同样,message.g.cs的生成也是正确的,但是messageGRPC.cs没有。
在我的项目中,我安装了Google.Protobuf、Google.Protobuf.Tools、Grpc、Grpc.Core和来自NuGet的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发布于 2017-05-15 12:20:49
同样的问题在这里回答:source=footer#!msg/grpc-io/l6bZwTLbDb4/bYRBmx37AgAJ
请尽量避免重复发布相同的问题(我们正在监控堆栈溢出和grpc.io邮件列表,而双重发布只会增加管理负担,这不会使问题更有可能得到回答)。
https://stackoverflow.com/questions/43811712
复制相似问题