我正在使用 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/