![](/img/trans.png)
[英]The ADO.NET provider 'Oracle.ManagedDataAccess.Client' is either not registered in the machine or application config file, or could not be loaded
[英]How to replace the “oracle.manageddataaccess.client” section of machine.config with web.config section
Good morning, my application uses oracle.manageddataaccess.client, when installing oracle.managedDataAccess via Nuget, a reference was created in my web.config as below:
<configSections>
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess,
Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
要运行我的应用程序,我需要 machine.config 文件中的相同部分。 (Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config),machine.config文件如下:
问题是,每当我需要使用不同版本的 oracle 运行另一个应用程序时,重复键就会发生错误,因为在 web.config 中配置了一个版本,而在 machine.config 中,该部分配置了另一个版本。 始终需要手动编辑文件 machine.config 并根据 web.config 的版本设置版本。
我试图解决这个问题的是:
allowOverride="true"
(无法识别的属性)<clear />
元素(不成功) 我发现在不需要放置手动版本的其他机器上, machine.config 使用oracle.dataaccess.client
部分,所以我研究是由于使用了非托管 odp.net 驱动程序,因此也更改了我的部分不行。
有什么方法可以覆盖此部分吗? 或者使用oracle.dataaccess.client
来解决这个问题。
我通过在 web.config 中使用以下内容使其工作:
<configSections>
<section name="new.oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
稍后使用新的配置部分:
<new.oracle.manageddataaccess.client>
<version number="*">
<!--Oracle configuration settings-->
</version>
</new.oracle.manageddataaccess.client>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.