I have a solution laid out like this:
As you can see, I've successfully linked service.proto into my OrchestrationServer project by adding this to my .csproj file:
<Protobuf Include="..\RequestHandler\Protos\service.proto" GrpcServices="None" ProtoRoot="..\RequestHandler\Protos\"/>
My question now is, how can I actually import this into my orchestrator.proto file? I've tried all sorts of paths without any luck. Currently, the two .proto files look like this
orchestrator.proto:
syntax = "proto3";
option csharp_namespace = "OrchestratorService";
package test;
import "service.proto";
service Orchestrator
{
rpc EnqueueRequest(G_NewRequest) returns (G_NewResponse) { }
}
message G_NewRequest{
string originId = 1;
oneof request_type{
G_RequestType1 request1 = 2;
G_RequestType2 request2 = 3;
}
}
message G_NewResponse{
string response = 1;
}
service.proto:
syntax = "proto3";
option csharp_namespace = "RequestHandlerService";
package test;
service Handler
{
rpc AddItem1(G_RequestType1) returns (G_NewResponse) { }
rpc AddItem2(G_RequestType2) returns (G_NewResponse) { }
}
message G_RequestType1{
string request = 1;
}
message G_RequestType2{
string request = 1;
}
message G_NewResponse{
string originId = 1;
string response = 2;
}
Currently, errors are being thrown in orchestrator.proto for the referenced types from service.proto. Any help would be much appreciated. Additionally, if someone could lay out the extra steps that would be needed if the proto files declared different packages, that would be awesome too.