VS2022 C# grpc遇到的问题

1、obj\Debug\net8.0\Protos下没有生成的.cs文件或报错:.proto 应为get或set访问器。

在vs的解决方案资源管理器中,双击项目名称,打开编辑,添加

<ItemGroup>
<Protobuf Include="Protos\greet.proto" GrpcServices="Server" />
<Protobuf Include="Protos\abc.proto" GrpcServices="Server" />
</ItemGroup>

在重新生成

posted @ 2024-06-22 14:32  扬中源  阅读(2)  评论(0编辑  收藏  举报