How to force .NET application to run in 32bit mode

最后都变了- 提交于 2019-12-01 03:18:21

32-bit processes cannot load 64-bit DLLs and vice versa (see this for details). That means that if your process successfully loaded a 64-bit DLL then it most definitely is a 64-bit process. You can verify that in Task Manager (as Lasse suggested) or via other means described here. That article also has more information on .Net on Windows x64.

Correct, it sounds like the NHibernate assembly is built with AnyCPU as its platform target. You'll need an NHibernate assembly that is built for x86 specifically.

You can try RunAsx86

I use this tool to start .NET applications in x86 mode, when run them from command line.

n00b

In case it helps anybody, I was running into the same symptoms with Oracle 64 bit and Windows 7 64 bit. I left the platform target alone (did not change any project settings). Instead I simply installed oracle 32 bit and that resolved the issue. Be sure to update your environment variables (i.e. ORACLE_HOME, PATH) to point to the 32 bit version.

I have run into similar problem before. I have a windows service using Crystal Reports, everything was fine on my 64b machine, I tuned everything - the project was built to use x86 architecture.

The problem occurred when deployed to different machine, the service was failing because the Crystal Reports engine could not load log4net.dll 1.2.10 assembly. I checked the directory - the version there was 1.2.11, my local directory contained the same version. The bindingRedirect did not work.

Then I checked GAC - CR dlls are signed and were added to GAC by installer, log4net 1.2.10 was there but the processor architecture was not x86. After adding the log4net 1.2.10 for x86 architecture it worked like a charm.

I have got the same error in my c++ oracle application which i need to run on 64 bit machine build in 32 bit machine. the bad image error is due to intermixing of dlls of 32 bit and 64 bit so i used dependency walker to find which dlls are intermixed. In that application i found that oci.dll are of 64 bit as i have installed oracle client of 64 bit but all other dlls of 32 bit. so i installed the oracle client for 32 bit on 64 bit machine and resolved this error.

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