This content has been marked as final. Show 1 reply
Typically, when you get the "load a program with an incorrect format" exception, it's a mismatch in the bit-ness of the Oracle client you're using and the project you're building. By default, .net builds in AnyCPU mode. That means if you do it on a 64 bit system, you'll get a 64 bit (x64) program. That doesn't work with a 32 bit Oracle client. Usually, you'll need to force MSBUILD to build a 32 bit (x86) result. That will use the 32 bit Oracle client successfully. There's probably a command line switch for that. When building in Visual Studio, you can do it from the Build > Configuration Manager menu.
Now in this case it looks like you actually have both 32 and 64 bit versions of Oracle.DataAccess in the GAC, so I'm not sure if you have both Oracle clients or not. If you have one in the \bin with Copy Local = True, you could be getting the wrong one. You'll want to set Copy Local = False on the properties of the reference and remove that file from the \bin.