【发布时间】:2020-03-18 10:28:03
【问题描述】:
我正在尝试做一个简单的 gRPC 教程。最初我通过创建一个新的 gRPC 服务开始使用 Jetbrains Rider,然后我为客户端创建了一个控制台应用程序并安装:
Google.Protobuf - 3.11.4
Grpc.Net.Client - 2.28.0-pre2
Grpc.Tools - 2.28.0-pre3
它看起来不像为 greet.proto 生成的代码正在生成,因为我得到了红色的波浪线 var client = new Greeter.GreeterClient(channel);
但是,当我在 Visual Studio 中打开项目时,似乎一切正常。我在这里缺少插件或其他东西吗?
我的csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.11.4" />
<PackageReference Include="Grpc.Net.Client" Version="2.28.0-pre2" />
<PackageReference Include="Grpc.Tools" Version="2.28.0-pre3" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="Protos\greet.proto">
<GrpcServices>Client</GrpcServices>
<OutputDir>obj\Debug\netcoreapp3.1\</OutputDir>
<Access>Public</Access>
<ProtoCompile>True</ProtoCompile>
<ProtoRoot></ProtoRoot>
<CompileOutputs>True</CompileOutputs>
<Generator>MSBuild:Compile</Generator>
</Protobuf>
</ItemGroup>
</Project>
【问题讨论】:
标签: asp.net-core jetbrains-ide