You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose I have a file1.proto and it imports file2.proto at other path, file2.proto imports file3.proto at anther path. And many other imports. How can I import file1.proto and use methods inside it with dotnet-grpc tools?
Thanks.
The text was updated successfully, but these errors were encountered:
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.
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.
For files that are external to your project, there are articles online on how to package .proto files correctly in a nuget, similar to how Wellknown .protos are distributed.
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.
The text was updated successfully, but these errors were encountered: