Reputation: 990
I have a console application which works perfectly in 32 bit machine. But I'm having problem running the executable in 64 bit windows server. The error message I get is:
The type initializer for "Sybase.Data.AseClient1.AseConnection" threw an exception. System.BadImageFormatException. An attempt was made to load a program with incorrect format. at Sybase.Data.AseClient.Unmanaged.AseGetDriverVersion at Sybase.Data.Aseclient1.AseConnection.CheckVersion().
Has anyone seen this error?
Update: After compiling in X86, I get:
Major version mismatch sybdrvado20.dll. Expecting major version '2'. Loaded version 1 at Sybase.Data.AseClient1.AseConnection.CheckVerison.
Please note that the server has latest Sybase version.
Upvotes: 3
Views: 12782
Reputation: 639
Regarding the error "Major version mismatch sybdrvado20.dll...", what solved for me was replacing the old version of sybdrvado20.dll that was in the bin folder of my application (located in the server) for the new one, located in C:\Sybase\DataAccess\ADONET\dll or C:\Sybase\DataAccess64\ADONET\dll. To check the version of the dll, right-click the file, go to Properties and click in the tab Details.
Upvotes: 0
Reputation: 21
Even easier, download the x64 version http://www.sybase.com/detail?id=1051287&elq=00000000000000000000000000000000
Upvotes: 2
Reputation: 4579
I had similar problems, because the driver is 32 bit. so try to build your application for x86. You can do this in your project properties.
Upvotes: 1