【问题标题】:What library am I missing if Google.Api.AnnotationsReflection is missing from my gRPC project?如果我的 gRPC 项目中缺少 Google.Api.AnnotationsReflection,我缺少什么库?
【发布时间】:2017-12-13 15:37:48
【问题描述】:

我使用我创建的项目使用 Protoc 工具版本 1.7.2 构建了一些协议缓冲区,遵循此处的教程: https://grpc.io/docs/quickstart/csharp.html#update-and-run-the-application

从 .proto 文件生成的代码吐出了这一行: 新 pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, },

我已尝试将所有 nuget 依赖项更新到 1.8.0。仍然缺少这个库。该术语过于笼统,无法通过网络搜索找到任何有用的内容。

我需要包含哪些内容才能使其正常工作?

【问题讨论】:

  • 这个问题实际上与 gRPC 无关。看起来您的一些 .proto 文件正在导入“google/api/annotations.proto”(并且在编译 annotations.proto 时生成了 Google.Api.AnnotationsReflection.Descriptor 的描述符 - 你有 1.)忘记生成annotations.proto 的代码 2.) 没有在您的项目中包含为 annotations.proto 生成的 c# 文件?

标签: c# protocol-buffers grpc


【解决方案1】:

安装包“Google.Api.Gax.Grpc”。

从 Visual Studio 的包管理器控制台中选择您的项目,然后运行: 安装包 Google.Api.Gax.Grpc

【讨论】:

    【解决方案2】:

    安装 nuget 包“Google.Api.CommonProtos”有效,我相信它已从“Google.Api.Gax.Grpc”中删除

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 2012-10-01
      • 2011-07-12
      • 1970-01-01
      • 2010-10-29
      • 2011-03-24
      • 1970-01-01
      相关资源
      最近更新 更多