获取web.config中指定ODP.net版本这是从已安装的版本不同 [英] Getting web.config to specify version of ODP.net that's different from installed version

查看:391
本文介绍了获取web.config中指定ODP.net版本这是从已安装的版本不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的web.config文件以下

I have the following in my web.config file

    <DbProviderFactories>
      <remove invariant ="Oracle.DataAccess.Client" />
      <add name="ODP.NET, Unmanaged Driver" 
          invariant="Oracle.DataAccess.Client" 
          description="Oracle Data Provider for .NET, Unmanaged Driver"   
          type="Oracle.DataAccess.Client.OracleClientFactory, 
          Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, 
          PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>

我的机器是用OPD.net版本4.121.1.0,我已经添加了引用到该文件,并规定应当复制到本地。我的部署服务器有一个更旧的客户端10.2.0.100和位于D:\\ ORACLE \\产品\\ 10.2.0 \\ DB_1 \\ BIN。因为这个应用程序将被部署到多个服务器配置,我不希望有管理的每个服务器的Oracle客户端。我认为,通过添加

My development machine is using OPD.net version 4.121.1.0 and I have added the reference to that file and specified that it should be copied locally. My deployment server has a much older client 10.2.0.100 and resides in D:\oracle\product\10.2.0\db_1\BIN. Because this application will be deployed to multiple server configurations, I don't want to have to manage each server's Oracle client. I thought that by adding

&LT;清除不变=Oracle.DataAccess.Client/&GT;

我将消除与其他版本的任何冲突,除了我得到...

I would remove any conflicts with other versions except I'm getting...

The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception

看完后,似乎有可能是能够只使用上面的线在我的web.config和我指定要使用的ODP.net的版本,但它不是为我工作。就是我在寻找可能的,这是做它的正确方法是什么?

After reading, it seems possible to be able to just use the above lines in my web.config and specify which version of ODP.net I want to use, but it isn't working for me. Is what I'm looking for possible, and is this the correct way of doing it?

感谢您。任何帮助是极大的AP preciated。

Thank you. Any help is greatly appreciated.

推荐答案

在非托管供应商是由两部分组成:有驱动程序 - Oracle.DataAccess.dll和管理的客户端(通常被称为甲骨文的管理家)。虽然我猜想可能有一些不匹配,你问11g的驱动程序与10g的客户,我不认为10G甚至支持.NET 4.0(这是你在加载驱动程序)。你可能没有选择,只能到,如果你想使用.NET 4.0和非托管提供商更新您的服务器。

The "unmanaged" provider is made up of two parts: There's the managed driver- Oracle.DataAccess.dll and the unmanaged client (typically referred to as "Oracle Home"). While I'd guess there could be some mismatch, you're asking the 11g driver to talk to a 10g client and I don't think 10g even supported .net 4.0 (which is the driver you're loading). You may have no choice but to update your server if you want to use .net 4.0 and the unmanaged provider.

也就是说,如果服务器的依赖是一个问题,我只想使用managed供应商。非托管提供商管理的.NET程序集的坐在几十年的历史unmanged的DLL(Oracle客户端)的顶部有一个大杂烩。托管的提供者是全新的,从无到有的界面,最终放弃客户端上的旧的依赖,真正让你在短短的DLL和运行的下降。

That said, if server dependencies are an issue, I would just use the managed provider. The unmanaged provider is a hodge-podge of managed .net assemblies sitting on top of decades old unmanged dlls (Oracle Client). The managed provider is the brand new, from scratch interface that finally abandons the old dependency on the client and truly lets you drop in just a couple of dlls and run.

这篇关于获取web.config中指定ODP.net版本这是从已安装的版本不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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