We have a winforms appliction that has to talk to an AS400. To do this we imported the IBM.Data.DB2.iSeries classes in the Winforms application and have IBM System I Access for Windows on our machines. It must have the System I Access or it will not talk to the AS/400. Everything works fine on my 64bit development machine. It also works fine on the client’s 64bit machine. However when we attempt to install it on a 32bit machine we get a Bad Image format exception. We tried making just an x86 installer instead of any cpu but that did not work (same bad image exception). Any ideas?
Share
Even though you have compiled your program to 32-bit, somewhere it is still trying to load a 64-bit dll. Since you say that the 3rd party dll’s are 32bit, what is left are your own dll’s.
You can verify that by setting the solution platform to x86. Then check all your projects (exe and dll) if they are set to x86. I suspect one of them has a platform target set to x64. You check them by right clicking Project, select Properties, Build-tab -> Platform Target.
Also make sure that all dlls are actually set to Build in the Configuration Manager (Select “Configuration Manager…” from the Solution Platforms dropdown in the menubar.