We did solve this, primarily by switching tools. Previously NuGet's Google.Protobuf.Tools was used in conjunction with a Visual Studio 2019 pre-build event that manually called protoc. Both Google/Timestamp.proto and Google/Empty.proto were added to the Protos folder. For some reason these were added to the proto compile step by visual studio which had the bad effect of creating duplicate definitions. In addition, the gRpc service was never generated. We dropped Google.Protobuf.Tools and instead referenced the NuGet gRpc.Tools package and removed the extra proto builds from the csproj. It works. On Monday, January 11, 2021 at 4:44:17 PM UTC-5 Tom Hintz wrote:
> This configuration is not supported? > > On Thursday, January 7, 2021 at 2:56:51 PM UTC-5 Tom Hintz wrote: > >> I'm experimenting with retro-fitting a .Net 4.8 service with a gRPC >> service and I'm unclear how this works. I followed a tutorial that >> specified adding the following to the project. I assume the .csproj file: >> >> >> <ItemGroup> >> <Protobuf Include="**/*.proto" /> >> </ItemGroup> >> >> This doesn't appear to create output. I then added a custom pre-build >> step the produces one file ProtoModels\Licenses.cs. >> >> %USERPROFILE%\.nuget\packages\google.protobuf.tools\3.14.0\tools\windows_x86\protoc.exe >> >> --proto_path=$(ProjectDir)Protos --csharp_out=$(ProjectDir)ProtoModels >> Licenses.proto >> >> In constrast, the Greet sample generates a Greet.cs and GreetgRPC.cs >> in obj\Debug\netcoreapp3.1. >> >> Can someone clarify the best way to retrofit an older .Net 4.8 visual >> studio csproj to build a gRpc service? >> >> -- 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/63cb0339-1590-411d-9d2d-180f17abb69dn%40googlegroups.com.
