Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Oracle Client in 32-bit mode on a 64-bit machine

I have just moved from a 32-bit Windows 7 desktop to a 64-bit Windows 7 Laptop. We have a C# program that we are developing that contains approximately 60 projects within the solution. I keep getting the following error whilst trying to build:

Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed

Obviously the error is quite self explanatory and I am trying to get my whole solution to load in 32 bit mode. I have gone through every single project and set the target platform to x86 but I am still getting this error. I have searched Google and seen countless different approaches, but I cant seem to fix this problem. What is the best way to ensure my project is running in 32-bit mode on a 64-bit machine?

I am using Visual Studio 2008. I am currently considering downgrading to 32-bit but really want to avoid having to do this.

like image 653
Joseph Avatar asked May 14 '13 08:05

Joseph


1 Answers

You have to change your main .exe file to run only as 32-bit. You can do this in Visual Studio - just change Platform target from "Any CPU" to "x86". https://msdn.microsoft.com/en-us/library/ms185328.aspx

like image 166
user7597235 Avatar answered Sep 19 '22 10:09

user7597235