System.Data.OracleClient无法与64位Oracle Client一起使用 [英] System.Data.OracleClient not working with 64 bit Oracle Client

查看:51
本文介绍了System.Data.OracleClient无法与64位Oracle Client一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个C#应用程序来连接到Oracle数据库并更改模式用户密码.我的参考程序集是System.Data.OracleClient,它位于以下位置:"C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.5 \ System.Data.OracleClient.dll"

I have designed a C# application to connect to Oracle Database and change schema users passwords. My reference assembly is System.Data.OracleClient from the location: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.OracleClient.dll"

我用来设计/测试应用程序的平台如下所示:1. 64位Windows 7平台.2. 32位.Net Frameworkv4.53. 32位Oracle 10g客户端.

The platform that I used to design/test the application looks like this: 1. 64 bit Windows 7 platform. 2. 32 bit .Net Frameworkv4.5 3. 32 bit Oracle 10g Client.

我也需要该应用程序才能在64位Oracle Client上运行.但是,当我将二进制文件转移到已安装64位Oracle 11g的计算机上时,出现以下错误:试图加载Oracle客户端库时抛出BadImageFormatException.在安装了32位Oracle客户端组件的64位模式下运行时,会出现此问题.."

I need this application to run for 64 bit Oracle Client too. But when I transfer my binaries to a machine which has 64 bit Oracle 11g installed, I get this error: "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."

我不确定如何解决此问题.请建议我是否需要进行任何代码更改或程序集引用.我浏览了很多类似的论坛,但找不到任何有用的信息.请帮忙!

I am not sure how to work around this issue. Please suggest if I need to make any code changes or assembly reference. I read through a lot of similar forums but could not find anything helpful. Please help!

推荐答案

首先,不建议使用提供程序 System.Data.OracleClient .Microsoft不再支持它,您应该考虑使用Oracle提供程序 Oracle.DataAccess Oracle.ManagedDataAccess .

First of all, provider System.Data.OracleClient is deprecated. Microsoft is not supporting it anymore, you should consider to use the Oracle provider Oracle.DataAccess or Oracle.ManagedDataAccess.

我的建议是在开发机器上安装32位和64位Oracle Client,然后就可以测试和构建任何东西.以下是如何执行此操作的说明:

My recommondation is to install both, 32-bit and 64-bit Oracle Client on your developing machine, then you can test and build anything. Here is an instruction how to do this: Install x86 and x64 Oracle Client on one machine

x86 Oracle客户端可以连接到64位Oracle数据库,反之亦然.

An x86 Oracle client can connect to a 64 bit Oracle Database, vice versa is also no problem.

这篇关于System.Data.OracleClient无法与64位Oracle Client一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆