3

Currently working with IBM DB2, Openshift and Linux using the IBM DB .NET Core Provider.

When running the application it errors with

System.DllNotFoundException: Unable to load shared library 'db2app64.dll' or one of its dependencies.

In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable:

libdb2app64.dll: cannot open shared object file: No such file or directory at IBM.Data.DB2.Core.UnsafeNativeMethods.DB232.SQLFreeConnAttribsADONET(DB2SQLGetConnAttribsADONETParams& pParam)

mao
  • 11,321
  • 2
  • 13
  • 29
Andrew
  • 1,696
  • 2
  • 16
  • 20
  • Which Db2-client (IBM Data Server Client) have you installed ? – mao Apr 02 '19 at 07:30
  • 1
    It's the IBM.EntityFrameworkCore nuget package i.e. https://www.nuget.org/packages/IBM.EntityFrameworkCore/1.3.0.100 – e p Apr 02 '19 at 09:27
  • Did you modify your PATH environment to include %userprofile%\.nuget\packages\IBM.Data.DB2.Core\\build\clidriver\bin (You will need to stop and restart VS after changing this environment variable). – mao Apr 02 '19 at 09:49
  • @mao this is not running windows or visual studio. It is running on linux in a container. – Andrew Apr 02 '19 at 18:55
  • Code that runs natively on Linux won't use DLL files . – mao Apr 03 '19 at 08:15

1 Answers1

7

The solution was to reference the IBM.EntityFrameworkCore-lnx for Linux builds.

.net was attempting to load the windows library db2app64.dll hence the reason why it was throwing the error. Unable to load shared library 'db2app64.dll'

enter image description here

Andrew
  • 1,696
  • 2
  • 16
  • 20