在 Win 10 64 位上使用 Oracle 客户端 32 位

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33516389/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:04:19  来源:igfitidea点击:

Using Oracle client 32 bit on Win 10 64 bit

oracle

提问by Mr Neo

I am using Windows 10 64 bit and Oracle client 32 bit (It's my company requirement). But when I open some existed program, it display a dialog with error:

我使用的是 Windows 10 64 位和 Oracle 客户端 32 位(这是我公司的要求)。但是当我打开一些现有的程序时,它显示一个错误对话框:

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

尝试加载 oracle 客户端库引发了 badimageformat 异常。在安装了 32 位 Oracle 客户端组件的情况下在 64 位模式下运行时会出现此问题

I had fixed by add Enviroment variables but it's not working. I am searching around Google, but the solution almost about fix on Visual Studio when developing application.

我通过添加环境变量来修复,但它不起作用。我在 Google 上搜索,但解决方案几乎是在开发应用程序时修复 Visual Studio。

These program is existed, not run from Visual Studio.

这些程序是存在的,不是从 Visual Studio 运行的。

How should I do to make application which using Oracle client 32 bit on OS 64 bit?

我应该如何制作在 OS 64 位上使用 Oracle 客户端 32 位的应用程序?

回答by Wernfried Domscheit

A 32 bit application requires also a 32 bit Oracle Client. A 64 bit application (resp. "AnyCPU" on windows 64 bit) requires a 64 bit Oracle Client.

32 位应用程序还需要 32 位 Oracle 客户端。64 位应用程序(在 Windows 64 位上对应“AnyCPU”)需要 64 位 Oracle 客户端。

Unless you use the ODP.NET Managed Driver (see here) there is not way to get rid of it. One solution is to install both, 32 bit and 64 bit Oracle Client, follow this instruction: BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed

除非您使用 ODP.NET 托管驱动程序(请参阅此处),否则无法摆脱它。一种解决方案是安装 32 位和 64 位 Oracle 客户端,请按照以下说明进行操作:BadImageFormatException。在安装了 32 位 Oracle 客户端组件的情况下以 64 位模式运行时会发生这种情况