1.下载protoc工具点击下载 2.下载解压后打开文件,其中有一个.bat文件,里面对应命令行如下: 编写如下命令行 protoc.exe-I=.--csharp_out=.--grpc_out=.--plugin=protoc-gen-grpc=grpc_csharp_plugin.exe helloworld.proto 把你想要生成的.proto文件放在此目录,修改 helloworld.proto名称为要生成的文件,运行即可...
1.下载protoc工具点击下载 2.下载解压后打开文件,其中有一个.bat文件,里面对应命令行如下: 编写如下命令行 protoc.exe -I=. --csharp_out=. --grpc_out=. --plugin=protoc-gen-grpc=grpc_csharp_plugin.exe helloworld.proto 把你想要生成的.proto文件放在此目录,修改 helloworld.proto名称为要生成的文件,运...
--csharp_out=OUT_DIR Generate C# source file. --java_out=OUT_DIR Generate Java source file. --javanano_out=OUT_DIR Generate Java Nano source file. --js_out=OUT_DIR Generate JavaScript source. --objc_out=OUT_DIR Generate Objective C header and source. --python_out=OUT_DIR Generate ...
--csharp_out=OUT_DIR Generate C# source file. --java_out=OUT_DIR Generate Java source file. --javanano_out=OUT_DIR Generate Java Nano source file. --js_out=OUT_DIR Generate JavaScript source. --objc_out=OUT_DIR Generate Objective C header and source. --python_out=OUT_DIR Generate ...
--cpp_out=OUT_DIR 产⽣C++头⽂件和源⽂件 --csharp_out=OUT_DIR 产⽣C#源⽂件 --java_out=OUT_DIR 产⽣Java源⽂件 --javanano_out=OUT_DIR 产⽣Java Nano源⽂件 --js_out=OUT_DIR 产⽣JavaScript源⽂件 --objc_out=OUT_DIR 产⽣Objective C头⽂件和...
protoc -I=. --java_out=. example.proto 这将生成ExampleProto.java文件。 生成Go代码: bash protoc -I=. --go_out=. example.proto 这将生成example.pb.go文件。 生成C#代码: bash protoc -I=. --csharp_out=. example.proto 这将生成Example.cs文件。
--go_out=. #表示编译后的文件存放路径;如果编译的是 csharp,则 --csharp_out --go_opt={xxx.proto}={xxx.proto的路径} # 示例:--go_opt=Mprotos/bar.proto=example.com/project/protos/foo 1. 2. 3. 4. 最简单的编译命令: protoc --go_out=. *.proto ...
--python_out指定生成Python代码文件目录 --go_out指定生成Go语言代码文件目录 --csharp_out指定生成C#代码文件目录 --objc_out指定生成Objective-C代码文件目录 --ruby_out指定生成Ruby代码文件目录 --js_out指定生成JavaScript代码文件目录 使用示例: protoc --proto_path=./ --cpp_out=./output ./message.pr...
protoc --proto_path=IMPORT_PATH --cpp_out=DST_DIR --java_out=DST_DIR --python_out=DST_DIR --go_out=DST_DIR --ruby_out=DST_DIR --objc_out=DST_DIR --csharp_out=DST_DIR path/to/file.proto 我们想要编译同时编译多个文件 只需要把path/to/file.proto改为path/to/*.proto 即可。
--descriptor_set_out=FILE defined in descriptor.proto) containing all of the input files to FILE.--include_imports When using --descriptor_set_out, also include all dependencies of the input files in the set, so that the set is self-contained.--include_source_info When using --desc...