简体   繁体   English

Oracle.DataAccess.dll提供程序和dll不兼容

[英]Oracle.DataAccess.dll Providers and dll not compatible

I have recently taken a position as an application developer and without much experience I am unable to determine the root of my problem. 我最近担任了应用程序开发人员,并且由于没有太多经验,我无法确定问题的根源。 I have searched through the forums and have not be able to draw a conclusive answer to my specific problem, therefore I am asking a question. 我在论坛上进行了搜索,但无法对我的特定问题做出结论性的答案,因此我提出了一个问题。 My apologies beforehand if I offend anyone or break any rules as I am new to this site. 如果我冒犯任何人或违反任何规则,我事先表示歉意,因为我是这个网站的新手。

I have several applications that require the use of oracle.dataaccess.dll. 我有几个需要使用oracle.dataaccess.dll的应用程序。 I have installed the oracle client x32 as requested by my employer. 我已经按照我的雇主的要求安装了oracle客户端x32。 When I attempt to run any applications that require the oracle.dataaccess.dll file, I am met with varying errors. 当我尝试运行需要oracle.dataaccess.dll文件的任何应用程序时,遇到各种错误。

Most application use the 4.xx.xx.xx version of the dll, which does not appear for my oracle client (I assume its because I installed the 32bit). 大多数应用程序都使用dll的4.xx.xx.xx版本,该版本对我的oracle客户端不显示(我假定是因为我安装了32位)。 When I attempt to use the 32 bit version I get various errors: 当我尝试使用32位版本时,出现各种错误:

  1. The provider is not compatible with the version of Oracle client 提供程序与Oracle客户端版本不兼容

or 要么

  1. Could not load file or assembly. 无法加载文件或程序集。 'Oracle.DataAccess.dll' or one of its dependancies. “ Oracle.DataAccess.dll”或其相关性之一。 An attempt was made to load a program w/ an incorrect format. 试图加载格式错误的程序。

or 要么

  1. The provider may not be installed. 提供程序可能未安装。

If I attempt to use the oracle.dataaccess.dll that is used on the production servers, I get the same errors. 如果我尝试使用生产服务器上使用的oracle.dataaccess.dll,则会遇到相同的错误。

  1. What is the 'provider' and how can I figure out which one(s) I have installed? 什么是“提供商”?如何确定已安装的提供商?

  2. Should I have any of these dlls stored in my GAC? 我应该将这些dll中的任何一个存储在我的GAC中吗?

  3. I have absolutely no idea where I need to go from here as I have tried everything that I know. 我已经完全尝试了我所知道的一切,但我完全不知道该从哪里去。 I even uninstalled my Oracle Client and reinstalled to no avail. 我什至卸载了Oracle Client并重新安装也无济于事。 Please, any information that would point me towards a good tutorial or how to use oracle.dataaccess would be much appreciated. 拜托,任何能使我获得良好教程或如何使用oracle.dataaccess的信息,将不胜感激。

Again I apologize beforehand for any trouble. 如有任何麻烦,我再次表示歉意。

Some generic points: 一些通用的要点:

  • ODP.NET (ie Oracle.DataAccess.dll ) requires an Oracle Client installation. ODP.NET(即Oracle.DataAccess.dll )需要安装Oracle Client。 The stand-alone DLL does not work. 独立DLL不起作用。
  • The architecture (ie 32 vs. 64 bit) of Oracle.DataAccess.dll must match the architecture of the installed Oracle Client and the architecture of your application. Oracle.DataAccess.dll的体系结构(即32位和64位)必须与已安装的Oracle Client的体系结构和您的应用程序的体系结构匹配。
  • The version (eg 2.x or 4.x of Oracle.DataAccess.dll ) must match the .NET compile target of your application. 版本(例如Oracle.DataAccess.dll 2.x4.x )必须与应用程序的.NET编译目标匹配。 If you compile on target 2.0, 3.0 or 3.5 you must install version 2.x . 如果在目标2.0、3.0或3.5上编译,则必须安装版本2.x For compile target 4 or above you must install version 4.x 对于编译目标4或更高版本,必须安装版本4.x
  • The version (eg x.111 , x.112 , x.121 , etc.) should match the version of installed Oracle Client. 版本(例如x.111x.112x.121等)应与已安装的Oracle Client的版本匹配。

Regarding your questions: 关于您的问题:

The provider is the DLL Oracle.DataAccess.dll . 提供程序是DLL Oracle.DataAccess.dll It can be a local copy in your application binary folder or installed in GAC. 它可以是应用程序二进制文件夹中的本地副本,也可以安装在GAC中。

It does not matter whether you use the GAC or not. 是否使用GAC都无关紧要。 Personally I prefer to use the GAC but you can also provide a local copy. 我个人更喜欢使用GAC,但您也可以提供本地副本。

You can interrogate the installed providers with gacutil.exe tool: 您可以使用gacutil.exe工具查询已安装的提供程序:

C:\>gacutil /l Oracle.DataAccess
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.18020
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies:
  Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
  Oracle.DataAccess, Version=2.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
  Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86
  Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86
  Oracle.DataAccess, Version=2.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86
  Oracle.DataAccess, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
  Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
  Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86

Number of items = 8

C:\>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM