简体   繁体   中英

System.BadImageFormatException while connecting to DB2 from .Net

I have DB2 server that I'm trying to connect from my machine, but I keep getting the below error when I start the application, before even start the connection

System.BadImageFormatException: 'Could not load file or assembly 'IBM.Data.DB2, Version=9.7.4.4, Culture=neutral, PublicKeyToken=7c307b91aa13d208' or one of its dependencies. An attempt was made to load a program with an incorrect format.'

please not that I don't have DB2 driver installed on my machine. but I refer to the below libraries in my application, which I got them from DB2 database server.

  • IBM.Data.DB2;
  • IBM.Data.DB2.Entity;
  • IBM.Data.Informix;

Normally the error message is caused by a 32/64 bit conflict.

Your program could be compiled in 64 bit (or any) and the drivers in 32 bit or the other way round.

Check the Configuration Manager and set the Platform to x86 or x64.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM