2017-05-05 30 views
0

我試圖使用生成一個bat文件GRPC的.cs文件,但該文件messageGRPC.cs沒有得到產生。但是,message.g.cs會被創建。有沒有錯誤,我甚至嘗試硬編碼的路徑,並具有相同的結果運行在管理員模式下的命令行窗口。GRPC不產生* grpc.cs

再次message.g.cs不會得到正確生成,但messageGRPC.cs沒有。

在我的項目中,我已經從NuGet安裝了Google.Protobuf,Google.Protobuf.Tools,Grpc, 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 

回答