0

I am trying to generate grpc .cs files using a .bat file, but the messageGRPC.cs file does not get generated. However, the message.g.cs DOES get created. There are no errors and I even tried hard coding the paths and running the command window in administrator mode with the same results.

Again the message.g.cs does get generated correctly, but the messageGRPC.cs does not.

In my project I have installed Google.Protobuf, Google.Protobuf.Tools, Grpc, Grpc.Core, and Grpc.Tools from NuGet.

Is there anything I'm doing wrong?

@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
GamerDev
  • 2,006
  • 4
  • 24
  • 31

1 Answers1

1

Same question answered here: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/grpc-io/l6bZwTLbDb4/bYRBmx37AgAJ

Please try to avoid double-posting identical questions (we are monitoring both stackoverflow and grpc.io mailing list and double posting only increases the administrative load, it doesn't make a question more likely to be answered).

Jan Tattermusch
  • 1,515
  • 9
  • 9
  • Sorry, I didn't know you were monitoring stackoverflow also – GamerDev May 15 '17 at 14:36
  • `double posting only increases the administrative load, it doesn't make a question more likely to be answered` It certainly makes the ANSWER more likely to be read, though - particularly when you consider that some sites (such as where I work) block access to Google Groups... – Matthew Watson Oct 06 '22 at 15:09