'Use Common Proto NuGet in C#

I am trying to use a Common proto project which contains common messages used.

My project structure for the common is this. It is a .Net 5 Class library.

enter image description here

I publish it as NuGet with following to include the files:

enter image description here

I then try to use the NuGet in another project with same structure. Here I already added the NuGet and I can see common.proto inside:

enter image description here

I then add the following in the .csproj:

enter image description here

And finally, try to use it:

enter image description here

But I receive errors when I try to compile:

enter image description here

It seems I followed exactly same way as here: https://github.com/grpc/grpc-dotnet/issues/183

But it doesn't work. Maybe I am doing something wrong?

I also tried import "Protos/common.proto but it did not work.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source