【问题标题】:Using Firestore with Azure Functions V2 (C#)将 Firestore 与 Azure Functions V2 (C#) 结合使用
【发布时间】:2019-09-01 16:28:19
【问题描述】:

我正在尝试将 Firestore 与 Azure Functions 一起使用,但出现以下错误:

System.Private.CoreLib:执行函数时出现异常: 你好世界。 Grpc.Auth:无法加载类型“Grpc.Core.CallCredentials” 从程序集'Grpc.Core.Api,版本=1.0.0.0,文化=中性, PublicKeyToken=d754f35622e28bad'。

我尝试使用这个问题的步骤:

Grpc.Auth: Could not load type 'Grpc.Core.CallCredentials' from assembly 'Grpc.Core.Api'

但是,它与语言 API 相关,并且该解决方案不适用于 Firestore。

我尝试将 Grpc.Auth 的版本更改为 1.19.0,但 Firestore 1.0.0 似乎不支持此版本。

如果我从项目中删除 Firestore 并使用 grps.Auth 1.19.0 来初始化 Credentials 对象 - 这是可行的。但该对象与 Firestore 不兼容。

我也尝试了该问题中描述的PostBuild/PostPublish 命令,但命令无法执行。

在尝试将 Firestore 与 Azure Functions 结合使用之前,我成功地将它与 .NET Core Web API 项目一起使用,但我在使用 Azure Functions 时遇到了困难,希望能得到任何帮助。

【问题讨论】:

  • 您是否尝试将 Grpc.Auth 更新到最新版本?

标签: c# firebase azure google-cloud-firestore google-authentication


【解决方案1】:

这似乎是 Azure Functions 中的一个错误,您可以参考此issue 进行跟踪。

如果您 update the cli directory 包含来自 Grpc.CoreGrpc.Core.Api 的相关文件,并相应地更新 func.deps.json,则一切正常 - 包括 Google.Cloud.Firestore

所以基本上,对于任何需要使用比嵌入在 CLI 应用程序中的版本晚的Grpc.Core 版本的函数来说,这都是一个问题。

【讨论】:

    猜你喜欢
    • 2019-03-26
    • 2021-11-03
    • 1970-01-01
    • 2019-03-05
    • 1970-01-01
    • 1970-01-01
    • 2018-08-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多