5

I am running 64 bit Windows 7. I have a .NET 4.0 web project and a Class Library Project that accesses an Informix database. I installed the IBM Informix Client SDK version 3.70.FC4 (64 bit version, .NET 2.0 runtime).

Per the IBM Informix .Net Provider Guide

  1. I added the directory %INFORMIXDIR%/bin/netf20/ to the PATH variable

  2. I added a reference to the IBM.Data.Informix.dll (version 3.0.0.2) in the Class Library Project.

When I run the web project I get this error:

Could not load file or assembly 'IBM.Data.Informix' or one of its dependencies.
An attempt was made to load a program with an incorrect format.

Any advice on what to do?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Andrew Thomas
  • 2,482
  • 3
  • 25
  • 29
  • Can you verify that your web application is running in 64-bit mode? e.g. make sure Environment.Is64bitoperatingsystem is true. – Peter Ritchie May 09 '12 at 22:39
  • Next question, are you using "Client Profile" in your build settings' Target Framework for the class library? – Peter Ritchie May 10 '12 at 15:34
  • The Target Framework is ".Net Framework 4" I assume that indicates the "Full Profile". – Andrew Thomas May 10 '12 at 21:20
  • Yep, that's the full version. I sometimes get incorrect format errors with Client Profile; so, just wanted to make sure it wasn't something easy like that. – Peter Ritchie May 10 '12 at 21:44
  • Does it work find in another application type, like Console? – Peter Ritchie May 10 '12 at 21:44
  • I don't know if it will work in application. I found a work around. I am using the ibm informix sdk 3.0. It installs a dll in the gac that is architecture MSIL. It works. The one from the 3.7 sdk is architecture AMD64, and it will not work on my machine, but it does work on the Windows 2008 64 bit server. – Andrew Thomas May 14 '12 at 14:10
  • Are you sure a downstream dependency of the IBM.Data.Informix being loaded in the app domain is indeed existing as a 64-bit assembly? Use Fusion Log viewer to see what is in fact happing during assembly probing. – Daniel P. Bullington Aug 21 '12 at 20:24

1 Answers1

2

My steps to solve:

  1. Choose the IBM.Data.Informix DLL under the list of References and open properties. Set 'Copy Local' = False.
  2. Clean solution and try to build.
Sergey Malyutin
  • 1,484
  • 2
  • 20
  • 44