I'm trying to link protobuf together from different projects in my solution. I seem to get File Not Found errors every time I build and can't find a way for the protobuf compiler to find the files.
The following protobuf files i'm using also a note that I trimmed some small things.
Project A
Service/Identity/Protos/User.Proto
import "Identity/Protos/Common.proto";
option csharp_namespace = "Service.Identity";
package user;
service ProfileController {
rpc CreateProfile(CreateProfileRequest) returns (common.GenericResult);
}
Project B
Shared/Protos/Common.Proto
option csharp_namespace = "Shared";
package common;
message GenericResult {
bool success = 1;
string exceptions = 2;
}
In the csproj files the following settings have been made.
Project A
<ItemGroup>
<Protobuf Include="Identity\Protos\User.proto" GrpcServices="Server" />
<Protobuf Include="..\Shared\Protos\Common.proto" Link="Identity\Protos\Common.proto" ProtoRoot=".." GrpcServices="None" >
</Protobuf>
Project B
<ItemGroup>
<Protobuf Include="Protos\Common.proto" GrpcServices="None" />
</ItemGroup>
The link seems to work but I can't import it in my user.proto
When I try and import it which I have tried in the following import statements in my user.proto seems to be able to find it.
import "Identity/Protos/Common.proto";
import "Protos/Common.proto";
import "Common.proto";
import "/Identity/Protos/Common.proto";
It gives me the following error.
All i want to do is be able to use the Common.Proto in my User.Proto. But it just does not work.