无法在C#,DLL问题中运行Google Cloud PubSub

哈米

我正在将Google Cloud PubSub集成到我的c#项目中,我使用NuGet安装1.0.0-beta11,完全没有错误。当我运行项目并到达使用pubsub的代码时,出现以下错误:

An unhandled exception of type 'System.IO.FileLoadException' occurred in 
 Google.Api.Gax.dll

Additional information: Could not load file or assembly 'Google.Apis.Auth, Version=1.21.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

NuGet确实安装了所有依赖项,包括Google.Apis.Auth.dll,但它是1.27.1。我尝试了所有我能想到的一切,包括获取1.21.0的dll并使用它,但没有成功。我已经能够正常运行.net示例,没有错误。

有什么想法吗?让我知道您是否需要更多信息

乔恩·斯基特

好的,我已经找到了对Google.Apis.Auth 1.21.0的引用-它位于Grpc.AuthNuGet包中。

如果仅添加对Grpc.AuthDLL的引用,则会遇到这种故障-但是如果您通过NuGet管理所有依赖项,我希望它可以-它将为您添加程序集绑定重定向。

在不知道您确切的设置的情况下,要讲的更多技巧是非常棘手的-可能是您的需要程序集绑定重定向,但是应用程序可以控制它们……尤其是如果您的应用程序仅引用了库DLL,这将导致问题。

解决方法是,您可以手动添加程序集绑定重定向(确切的操作方式取决于应用程序类型),也可以Google.Cloud.PubSub.V1在应用程序和库中添加对它的引用,此时NuGet将完成所有为您处理依赖项。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

获取从PubSub事件触发的Google Cloud Functions的执行ID

耗尽或清除Google Cloud pubsub主题的最佳做法

通过Google Cloud Dataflow将PubSub消息插入BigQuery

使用DoFn使用Cloud Dataflow从PubSub写入Google Cloud Storage

Google Cloud Pubsub数据丢失

google.cloud.pubsub_v1和google.cloud.pubsub有什么区别?

与Cloud Dataflow搭配使用时说明Google Cloud PubSub的费用

Google Cloud pubsub node.js客户端与Google Cloud功能不兼容

Google Cloud Function-ImportError:无法从“ google.cloud”(未知位置)导入名称“ pubsub”

Google Cloud Functions和PubSub-空闲后延迟

无法在Python中正确调用Google Cloud PubSub

google.cloud.pubsub_v1.PublisherClient线程安全吗?

使用GCloud Emulator的Google Cloud PubSub V1

从Cloud Functions触发PubSub消息

Python external_dependencies:“ google-cloud-pubsub”无效

如何为Google Cloud PubSub中的订阅提供到期时间

使用推送订阅测试Google Cloud PubSub模拟器

Google Cloud PubSub:如何仅读取最新记录

如何缩放activejob-google_cloud_pubsub worker?

没有名为providers.google.cloud.operators.pubsub的模块:Google Cloud Composer

Google Cloud PubSub-如何将多个参数发送到Cloud Function

GCP Cloud Function无法正确接收/确认PubSub消息

在Google Cloud PubSub中获取单个消息的大小

App Engine的Google Cloud Pubsub身份验证错误

Google Cloud PubSub 访问查询参数

setup.py 无法安装 google-cloud-pubsub

如何使用 Google Cloud Functions / Tasks / PubSub 进行批处理?

Google Cloud Dataflow - 从 PubSub 到 Parquet

Google Cloud Function 未在 PubSub 上发布,已超时