0

I have a C# console application that runs on a 64 bit Windows 2008 server and access Oracle 11g via ODP.net. It's been working for about 6 months.

I compile the program on my computer, making the build setting "Any CPU". I installed the appropriate 64bit Oracle dll on the Windows server 6 months ago and never replace it - I only replace the exe of the console app.

I updated it last night - and now I'm getting a BadImageFormat exception with the message that the Oracle assembly can't be found, which usually means I have the wrong compile package for the dll. I confirmed and I am still using the original Oracle dll. I also confirmed that I am compiling to "Any CPU" on my server.

I've even tried recompiling and reloading and finding the source of the original Oracle dll and reloading.

Has anyone seen this before? Any ideas?

user158017
  • 2,891
  • 30
  • 37

1 Answers1

0

So I found this after trial and error.

Turns out at some point I had updated the ODP version on my PC to a version 4., but the version on the server was 2.. While I had correctly accounted for 32bit versus 64bit, it was compiled to expect a specific version.

For some reason, I could NOT just copy the new DLL onto the server. I had to compile my application referencing the 4.* 64bit dll and then I could load everything to the server and have it work. And then I had to remove the reference and rereference the 32 bit in order to keep working on my PC. Annoying, but it works.

user158017
  • 2,891
  • 30
  • 37