我正在尝试将我的 .net 解决方案的 Git 存储库拉到同一台机器上的另一个文件夹中(只是为了确保它有效).
I'm trying to pull a Git repository of my .net solution over to another folder on the same machine (just to make sure it works).
在我使用的创建 IfxConnection
的项目中,当我尝试创建一个新的 IfxConnection
时,我得到一个 DllNotFoundException
,它被抛出通过 IBM Informix 驱动程序.
In the project I use that creates IfxConnection
s, when I try to create a new IfxConnection
I get a DllNotFoundException
, which is thrown by the IBM Informix driver.
我收到的消息是无法加载 DLL 'db2locale.dll':找不到指定的模块.(来自 HRESULT 的异常:0x8007007E)"并且堆栈跟踪(回读到构造函数调用)是:
The message I receive is "Unable to load DLL 'db2locale.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" and the stack trace (reading back to the constructor call) is:
at IBM.Data.Informix.UnsafeNativeMethods.IfxInteropAPP.sqloGetNormalizedLangFromLangId(Int16 lcid)
at IBM.Data.Informix.UnsafeNativeMethods.IfxLocale.sqloGetNormalizedLangFromLangId(Int16 lcid)
at IBM.Data.Informix.IfxResource.GetMsgPath(CultureInfo cultureInfo, String szResFileName)
at IBM.Data.Informix.IfxResource..ctor(CultureInfo cultureInfo, String szResFileName, String szMsgPath)
at IBM.Data.Informix.IfxResource..ctor(CultureInfo cultureInfo, String szResFileName)
at IBM.Data.Informix.IfxResources.GetResource(CultureInfo cultureInfo)
at IBM.Data.Informix.IfxResources.GetString(CultureInfo cultureInfo, String stringID)
at IBM.Data.Informix.Res.GetString(CultureInfo culture, String name)
at IBM.Data.Informix.ODC.InvalidArgument()
at IBM.Data.Informix.IfxConnPool.ReplaceConnectionStringParms(IfxConnection connection, String szValue, IfxConnSettings& pSettings, IfxConnSettingsInternal& pSettingsInternal, Boolean bAttach)
at IBM.Data.Informix.IfxConnection.set_ConnectionString(String value)
at IBM.Data.Informix.IfxConnection..ctor(String connectionString)
问题是,我的代码/项目没有直接引用这个 dll.我的代码在本地机器路径 C:Program FilesIBMIBM DATA SERVER DRIVERin
etf40_32IBM.Data.Informix.dll
IBM.Data.Informix>,就像我在所有其他项目中所做的那样,以及在从中克隆了该存储库的存储库中.从存储库打开原始项目不会产生任何错误.
The thing is, my code/project does not directly reference this dll. My code references IBM.Data.Informix
on the local machine path C:Program FilesIBMIBM DATA SERVER DRIVERin
etf40_32IBM.Data.Informix.dll
, as it does in all of my other projects, and in the repository from which this repository has been cloned. Opening the original project from the repository produces no errors.
谁能告诉我为什么会发生这个错误以及我可以做些什么来解决它?
顺便说一句,IBM Informix 驱动程序似乎在后台使用了大量的 DB2 连接代码,以至于在使用设计器生成的数据集的其他项目中,我只能使用 DB2 连接器类型连接到我的 Informix 数据库.因此是 DB2 标记,尽管它与 DB2 相关的原因还不是很明显.
As an aside, the IBM Informix driver seems to use a lot of the DB2 connection code in the background to the extent that, in other projects, which use designer-generated datasets, I can only connect to my Informix database using the DB2 connector type. Hence the DB2 tag, even though it's not immediately obvious why this would be DB2-related.
您使用的 IBM Informix .NET 驱动程序来自 IBM DB2 Data Server Driver 包;它不是本机 Informix .NET 提供程序.在理想情况下,如果 IBM DB2 数据服务器驱动程序包安装正确,那么您应该不会看到此错误.
The IBM Informix .NET drivers what you are using is from IBM DB2 Data Server Driver package; it is not the native Informix .NET provider. In ideal case if the IBM DB2 Data Server Driver package is installed correctly then you should not see this error.
如果您打算使用本机 Informix .NET 驱动程序,那么您可能需要取消引用项目中包含的当前二进制文件,然后引用本机 Informix .NET 驱动程序.本机 Informix .NET 提供程序的位置是 $INFORMIXDIRin etf20IBM.Data.Informix.dll
If your intention is to use the native Informix .NET drivers then you may need to dereference the current binary that you have included with the project and then make a reference to native Informix .NET drivers. The location of the native Informix .NET provider is $INFORMIXDIRin etf20IBM.Data.Informix.dll
仅供参考:IBM Informix .NET 驱动程序有两种风格,它们都具有相同的命名空间 (IBM.Data.Informix) 和相同的二进制名称 (IBM.Data.Informix.dll).
FYI: There are two flavors of IBM Informix .NET drivers, both of them have same namespace (IBM.Data.Informix) and same binary name (IBM.Data.Informix.dll).
其中一个使用 Informix 本机 (SQLI) 协议,另一个使用 DRDA 协议.具有本机协议的 IBM Informix .NET 驱动程序是 IBM Informix Client SDK 的一部分使用 DRDA 协议的是 IBM DB2 Data Server Driver 包的一部分.
One of them uses Informix native (SQLI) protocol and the other one uses DRDA protocol. The IBM Informix .NET drivers with native protocol is part of IBM Informix Client SDK The one that uses DRDA protocol is part of IBM DB2 Data Server Driver package.
现在 IBM Informix Client SDK 包括 IBM DB2 Data Server Driver 包,在安装过程中也作为可选组件.
Now IBM Informix Client SDK includes IBM DB2 Data Server Driver package also as an optional component during the installation.
这篇关于IBM .net 驱动程序找不到 db2locale.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!