Run AnyCPU as 32-bit on 64-bit systems

大憨熊 提交于 2019-12-10 13:06:22

问题


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?


回答1:


Have a look at CorFlags.exe.

Example (set 32BIT flag):

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



回答2:


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.



来源:https://stackoverflow.com/questions/10945664/run-anycpu-as-32-bit-on-64-bit-systems

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!