The tooling package you need here is Grpc.Tools, which should work fine in a class library.
On Sun, 18 Apr 2021 at 23:08, Chris Langlois <[email protected]> wrote: > Thanks for the recommendations. I can add .proto files to the Shared > projects. What I cannot do is add a build action for "protobuf compiler" to > enable automatic compilation in Visual Studio. For some reason that doesn't > seem to work within a shared project in particular. I tried manually > adding the PackageReference includes for protobuf and grpc that appear in > the client and server projects to the shared project .projitems file and it > doesn't seem to make any difference. > Thanks > On Sunday, April 18, 2021 at 12:56:38 PM UTC-6 [email protected] wrote: > >> What is stopping you from adding them to the shared project? What TFM is >> it targeting? This should JustWorkTM. You could also look at the csproj >> changes in the client and server, and try to apply the same changes in the >> shared project - it might tell you why it isn't happy. >> >> On Sun, 18 Apr 2021, 19:43 Chris Langlois, <[email protected]> wrote: >> >>> I'm using Protobuf and Visual Studio C#. I have a Client project, Server >>> project, and and shared project. I want my proto file and messages to live >>> within the shared project. I'm installed the Nuget packages for protobuf, >>> protobuf tools, grpc, grpc core, and grpc tools into both my client and >>> server projects (you cant add them to a shared project). The build action >>> for the proto file in my shared project cannot be changed to Protobuf >>> compiler for automatic compilation like it can if I put the .proto in >>> either the client or server project. >>> >>> Any thoughts on a better architecture or what I might be doing wrong >>> here. This seems like it should be a common architecture but it seems to be >>> a real struggle. >>> >>> Thanks! >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Protocol Buffers" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/protobuf/e9a8e8e4-e085-47aa-8f62-c34d65e9b11an%40googlegroups.com >>> <https://groups.google.com/d/msgid/protobuf/e9a8e8e4-e085-47aa-8f62-c34d65e9b11an%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/protobuf/f9d19c61-fcaf-4bee-92e2-16793d9b42fdn%40googlegroups.com > <https://groups.google.com/d/msgid/protobuf/f9d19c61-fcaf-4bee-92e2-16793d9b42fdn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Regards, Marc -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/CAF95VAxA95_%3D9Pb_cES-joivtY59N%3DxOaqS4Tbn6treekRqZ9g%40mail.gmail.com.
