Reputation: 574
I am writing a .NET Framework application and am trying to connect to a DB2 database on a server. When trying, I get the error "System.DllNotFoundException: 'Unable to load DLL 'db2app64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)'". Obviously, this is because that file is not in the directory, but I am having a hard time finding out what that file is and how I get it. Here is what I currently have installed via NuGet on the project:
Anything would be helpful. Thanks.
Upvotes: 5
Views: 7906
Reputation: 91
I had the same problem with the NuGet: IBM.Data.DB.Provider version="11.5.4000.4861" targetFramework="net452", which ships with a "clidriver" directory in it, with all necessary DLLs including 64 bit 'db2app64.dll', 32 bit 'db2app.dll' and other stuff to make a DB2 data access possible.
Thanks to Dependency Walker I was able to find out, that the MSVCR120.dll was missing on my Windows.
I downloaded the Visual C++ Redistributable Packages for Visual Studio 2013 the x86 and x64 bit versions (I am running on a 64bit Win10, and 64bit Windows Server 2016 Standard) and installed it in this sequence, 1st x86 and then x64 (but you may need e.g. the ARM version for your PC).
After I installed the C++ Redistributable 2013, it worked immediately for me without restart.
Note, that the "newer" NuGets, like e.g. IBM.Data.DB2.Core.3.1.0.400 have the necessary MSVCR120.dll inside the "clidriver" directory shipped with it, so no C++ Redistributable installation is necessary for them.
Upvotes: 3