我正在使用 nuget 包 IBM.Data.DB2.Core 版本 1.3.0.100 dll 将来自 Azure 函数的 DB2 数据库与 AzureFunctionsVersion V2 连接起来.应用程序构建成功.
I'm using nuget package IBM.Data.DB2.Core version 1.3.0.100 dll to connect DB2 database from Azure functions with AzureFunctionsVersion V2. Application builds successfully.
当我运行应用程序并使用 Postman 访问它时,我得到了异常:
When I run the application and hit it with Postman I get the exception:
System.Private.CoreLib:执行功能时出现异常:Personal-GetAgencyDownload.AgencyDownload:无法加载文件或程序集IBM.Data.DB2.Core,版本=1.2.2.201,文化=中性,PublicKeyToken=7c307b91aa13d208".无法找到或加载特定文件.(来自 HRESULT 的异常:0x80131621).System.Private.CoreLib:无法加载文件或程序集IBM.Data.DB2.Core, Version=1.2.2.201, Culture=neutral, PublicKeyToken=7c307b91aa13d208".
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
?
I see the 1.3.0.100
package, there isn't any other package. Why is it looking for 1.1.1.201
in runtime?
知道这有点晚了,但以防万一其他人在使用最新版本的 IBM.Data.DB2.Core(版本 3.1.0.300 在写作时间)对我来说,这是由于 Azure 功能平台默认为 32 位,而 IBM dll(或其依赖项之一)需要 64 位.将平台设置更改为 64 位可解决此错误.您可以在配置下找到设置>azure 门户中的常规设置.
Know this is a little late, but just in case others have this issue with the latest version of IBM.Data.DB2.Core (version 3.1.0.300 at time of writing) for me it was due to the Azure function platform defaulting to 32bit, and the IBM dll (or one of its dependencies) required 64bit. Changing the platform setting to 64 bit resolved this error. You can find the setting under configuration > general settings in the azure portal.
这篇关于IBM.Data.DB2.Core 在 azure 函数应用程序中引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!