[英]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: 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>
For my application to run, I need the identical section in the machine.config file.要运行我的应用程序,我需要 machine.config 文件中的相同部分。 (Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Config \ machine.config), machine.config file below:
(Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config),machine.config文件如下:
The problem is that whenever I need to run another application with a different version of oracle, the error occurs with duplicate key, because in web.config a version is configured, and in machine.config, the section is configured with another version.问题是,每当我需要使用不同版本的 oracle 运行另一个应用程序时,重复键就会发生错误,因为在 web.config 中配置了一个版本,而在 machine.config 中,该部分配置了另一个版本。 It is always necessary to manually edit the file machine.config and setting the version according to the version of web.config.
始终需要手动编辑文件 machine.config 并根据 web.config 的版本设置版本。
What I tried to accomplish to solve the problem was:我试图解决这个问题的是:
allowOverride="true"
in web.config section (Unrecognized Attribute)allowOverride="true"
(无法识别的属性)<clear />
element in section (no success)<clear />
元素(不成功) I found that on other machines where it is not necessary to put the manual version, machine.config uses the section oracle.dataaccess.client
, so I researched is due to using the unmanaged odp.net driver, changing my section for this too did not work.我发现在不需要放置手动版本的其他机器上, machine.config 使用
oracle.dataaccess.client
部分,所以我研究是由于使用了非托管 odp.net 驱动程序,因此也更改了我的部分不行。
Would there be any way to override this section?有什么方法可以覆盖此部分吗? Or use
oracle.dataaccess.client
to resolve this issue.或者使用
oracle.dataaccess.client
来解决这个问题。
I got it to work by using the following in web.config:我通过在 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>
And later use the new config section:稍后使用新的配置部分:
<new.oracle.manageddataaccess.client>
<version number="*">
<!--Oracle configuration settings-->
</version>
</new.oracle.manageddataaccess.client>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.