Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IBM DB2 issue--System.BadImageFormatException: Could not load file or assembly IBM.DB2.DLL or one of its dependencies

I am getting the above mentioned error message. I have made enough research and tried out various options but still no luck.

Here arethe details below:

OS: Windows 7 64 bit version

    Visual studio version: 2013 Premium

   .NET framework version is : 4.0.30319

   ASP.NET version: 4.0.30319.34249

   IIS version: 7.0

   DB2 installed path: C:\Program Files (x86)\IBM

   DLL path: C:\Program Files (x86)\IBM\SQLLIB\BIN\netf40\IBM.DB2.dll

   DLL Version: 9.7.4.4

I have also changed my solution configuration manager platform to Any CPU and also I have changed the settings in the application pool by setting the property enable 32-bit application to True.

But still am getting the same error. Is there any other workaround?

Please help me with your suggestions.

like image 749
Sam Avatar asked Dec 24 '22 18:12

Sam


1 Answers

This problem happened me these days and it was solved following what this IBM document says, that is to go to the reference in the project and set "Copy local" to false for DB2 dlls, referencing diretly the ones from the DB2 client setup

like image 199
Andrea Giovacchini Avatar answered Dec 31 '22 14:12

Andrea Giovacchini