c# - IBM.Data.DB2.Core 在 azure 函数应用程序中引发异常

标签 c# azure db2 azure-function-app

我正在使用 nuget 包 IBM.Data.DB2.Core 版本 1.3.0.100 dll 将 Azure 函数中的 DB2 数据库与 AzureFunctionsVersion V2 连接起来。应用程序构建成功。

当我运行应用程序并使用 Postman 命中它时,出现异常:

System.Private.CoreLib: Exception while executing function: Personal-GetAgencyDownload. AgencyDownload: Could not load file or assembly 'IBM.Data.DB2.Core, Version=1.2.2.201, Culture=neutral, PublicKeyToken=7c307b91aa13d208'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'IBM.Data.DB2.Core, Version=1.2.2.201, Culture=neutral, PublicKeyToken=7c307b91aa13d208'.

我看到 1.3.0.100 软件包,没有任何其他软件包。为什么它在运行时寻找1.1.1.201

最佳答案

知道这有点晚了,但以防万一其他人在使用最新版本的 IBM.Data.DB2.Core(撰写本文时版本为 3.1.0.300)时遇到此问题,这是由于 Azure 功能平台造成的默认为 32 位,而 IBM dll(或其依赖项之一)需要 64 位。将平台设置更改为 64 位解决了此错误。 您可以在 Azure 门户中的配置 > 常规设置下找到该设置。

关于c# - IBM.Data.DB2.Core 在 azure 函数应用程序中引发异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60458243/

相关文章:

c# - 如何使用 Microsoft Graph 创建 Microsoft Teams session 作为应用程序?

api - Azure Easy Tables 是否支持关系?

java - 不指定用户名和密码的 DB2 连接

c# - selenium webdriver 和检查警报消息

c# - 在 T4 模板中使用与模板存在于同一项目中的类型

c# - 如何使用 CefSharp 启用 Adob​​e Flash?

Azure DevOps 和 Azure Active Directory

java - 在数据库中存储 10 个 UTF8 字符,文本字符计数器不会失败

linux - DB2数据库从V9.5 aix迁移到V10.1 linux

c# - javascript 是否等效于 C#s HttpUtility.HtmlEncode?