user1443957
user1443957

Reputation:

Run AnyCPU as 32-bit on 64-bit systems

We are using a Third-Party assembly that seems to be compiled as AnyCPU.

However, we have a number of installations of our application where this leads to problems. This Third-Party assembly makes use of the oracle dataaccess library, and will not work on 64-bit machines where only a 32-bit oracle client is installed.

Installing a additional 64-bit oracle client would be possible, but also expensive (takes a lot of time, many machines have to be updated etc.)

Is there a way to force a AnyCPU .Net assembly to run as 32-bit without recompiling?

Upvotes: 9

Views: 3610

Answers (2)

Martin Liversage
Martin Liversage

Reputation: 106796

Assuming that you are building the .EXE that has a reference to a AnyCPU third party assembly you need to build your project as x86. This project can reference AnyCPU assemblies but being marked as x86 it will run as a 32 bit process on both 32 bit and 64 bit Windows.

Upvotes: 8

sloth
sloth

Reputation: 101032

Have a look at CorFlags.exe.

Example (set 32BIT flag):

corflags [path]\[YourAssembly.exe] /32Bit+

Upvotes: 8

Related Questions