Reputation:
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
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
Reputation: 101032
Have a look at CorFlags.exe.
Example (set 32BIT flag):
corflags [path]\[YourAssembly.exe] /32Bit+
Upvotes: 8