【问题标题】:System.data.OracleClient with 32 bits oracle client driver on Seven 64 bits Operating systemSystem.data.OracleClient 与 7 个 64 位操作系统上的 32 位 oracle 客户端驱动程序
【发布时间】:2011-12-08 15:59:42
【问题描述】:

我有一个从 asp.net 1.1 (VS 2003) 迁移到 Asp.net 2 (VS 2008) 的 Web 应用程序。 我在新版本上执行 Oracle 连接时遇到问题。开发环境是 64 位七。当生成具有所有 CPU 的应用程序时,我在 System.Data.OracleClient 上遇到问题,异常 System.BadImageFormatException: Tentative dechargement d'un program de format wrong. (HRESULT 异常:0x8007000B)。 .我在 x86 CPU 上生成,启动时出现此错误:

[BadImageFormatException: Impossible de Charger le fichier ou l'assembly 'CpimWebApplication' ou une de ses dépendances。暂定的 dechargement d'un program de format 不正确。]
System.Reflection.Assembly._nLoad(AssemblyName 文件名,字符串 代码库、证据组装安全、组装位置提示、 StackCrawlMark& stackMark,布尔 throwOnFileNotFound,布尔 forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, 证据组装Security, StackCrawlMark& stackMark, Boolean forIntrospection) +416
System.Reflection.Assembly.InternalLoad(字符串组装字符串, 证据组装Security, StackCrawlMark& stackMark, Boolean forIntrospection) +166 System.Reflection.Assembly.Load(String 组装字符串)+35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串 程序集名称,布尔星指令)+190

有什么问题?机器上的 Oracle 客户端是 32 位版本。 我在网上读到不能将 System.data.OracleClient 与 32 位 oracle 客户端一起使用?安装 64 位 Oracle 客户端是解决方案吗? TIA 问候

【问题讨论】:

    标签: .net windows system.data.oracleclient


    【解决方案1】:

    如果您在 64 位模式下运行应用程序,则不能使用 32 位 Oracle 驱动程序。

    您需要安装 64 位 Oracle 驱动程序并以 64 位模式运行您的应用程序,

    将应用程序设置为以 32 位模式运行。您可以通过选择您的应用程序池在 IIS 中执行此操作,转到高级设置并将“启用 32 位应用程序”设置为 true。

    【讨论】:

    • 加 1 用于将 IIS 对 32 的支持设置为 true。拯救了我的白人步行者之夜!
    【解决方案2】:

    GTG 是对的。

    但是,System.Data.OracleClient 已被弃用。 Microsoft 不再支持它。

    所以,我建议您使用 Oracle Data Provider for .Net:ODP.Net。

    您可以从以下网址下载:

    Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (32-bit) Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (x64)

    对于开发(Win7 64 位),请使用 32 位版本。我尝试了 64 位 Oracle 客户端,但没有成功。 对于生产(Wind2008R2 64 位),请使用 64 位版本。 请注意,它们必须是相同的版本 (11.2.1.0)。

    此外,请确保为“任何 CPU”编译您的应用,添加对 Oracle.DataAccess 的引用,将“特定版本”设置为“True”,将“本地副本”设置为“False”。这样,当您将应用部署到生产环境时,它会从 GAC 中查找相同的版本(11.2.1.0,64 位等效版本)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-26
      • 1970-01-01
      • 2011-07-07
      • 2013-08-29
      • 1970-01-01
      • 1970-01-01
      • 2011-09-03
      • 1970-01-01
      相关资源
      最近更新 更多