Open xky0007 opened 2 months ago
See Importing Definitions from Protocol Buffers' documentation.
See Importing Definitions from Protocol Buffers' documentation.
I found this. How to set proto_path with dotnet_grpc tools? Because the entry proto file I got from other project is not at root path.
The protocol compiler searches for imported files in a set of directories specified on the protocol compiler command line using the -I/--proto_path flag. If no flag was given, it looks in the directory in which the compiler was invoked. In general you should set the --proto_path flag to the root of your project and use fully qualified names for all imports.
See AdditionalImportDirs - Setting location of imported .proto files
entry proto file I got from other project
Out of curiosity: "other project" within the same VS-solution or totally different project (in a different local folder)? When the latter, please think about version control, CI or builds on other machines.
Suppose I have a
file1.proto
and it importsfile2.proto
at other path,file2.proto
importsfile3.proto
at anther path. And many other imports. How can I importfile1.proto
and use methods inside it with dotnet-grpc tools?Thanks.