1

I want to my app to work for target machines where the Oracle client could be 10 or 11. Is it possible to do it with ODP?

If in my app I reference Oracle.DataAccess.dll from my dev machine (i have ORA client11) - my app works only on target machines with client 11...

If I reference ODP from my client 10 - the app works only for machines with ORA client 10.

Is it possible to develop application(with ODP) which will work for both Oracle client versions 10, 11? I am asking for ORA client versions, not DB versions.

Thanks!

4

1 回答 1

0

我认为最安全的方法是建立在两个版本中较低的版本(2.102.2.20或其他版本Oracle.DataAccess.dll)。

如果机器安装了更高版本,您可以将策略安装到GAC(全局程序集缓存)中。此策略文件重定向引用2.102.2.20使用新版本ODP.NET(11.xxx.xx) 的应用程序。

使用正常的 Oracle 客户端安装,此策略文件应该已经在您的GAC.,但如果不是,您应该能够在ORACLE_HOME\odp.net\PublisherPolicy\2.x.

您应该能够将这些策略文件拖到您的GAC(开始 > 运行 > %systemroot%\assembly)中。

只要制定了正确的策略,您使用版本 10 构建的应用程序也应该在安装了 Oracle Client 11 的机器上运行。

注意:您也可以自己创建这样的策略文件;看看这个以获取更多详细信息

于 2012-03-10T23:02:23.503 回答