gpt4 book ai didi

odp.net-managed - Oracle ODP.NET 错误

转载 作者:行者123 更新时间:2023-12-04 05:06:31 26 4
gpt4 key购买 nike

我有一个 VS 2012 Web 项目。我安装了 ODP.NET,因为我们是 Oracle Workshop。我继承了一个使用 Oracle.ManagedAccess.Data 和 EF 的项目。

在 VS 2012 中运行该项目时,出现以下错误:

There is a duplicate 'oracle.manageddataaccess.client' section defined..

解决方案是在 web.config 中禁用以下行
<!--<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />-->

这很好。该项目已编译,但在执行一个简单的命令(例如在必须读取数据库的地方取回密码)时,又出现了另一个错误:
System.Data.ConstraintException: Column 'InvariantName' is constrained to be unique.  Value 'Oracle.ManagedDataAccess.Client' is already present.

现在我知道该错误是由 ODP.NET 触发的,并且它存在于 GAC 中,因此出现了双重错误报告。

是否还有另一行我应该注释掉,或者有没有办法简单地禁用 ODP.NET?我不想安装该客户端,因为我将它用于其他项目。

谢谢

最佳答案

我在 Oracle site 上发现了以下内容关于“定义了重复的‘oracle.manageddataaccess.client’部分。”:

If your application is a web application and the above entry was added to a web.config and the same config section handler for "oracle.manageddataaccess.client" also exists in machine.config but the "Version" attribute values are different, an error message of "There is a duplicate 'oracle.manageddataaccess.client' section defined." may be observed at runtime. If so, the config section handler entry in the machine.config for "oracle.manageddataaccess.client" has to be removed from the machine.config for the web application to not encounter this error. But given that there may be other applications on the machine that depended on this entry in the machine.config, this config section handler entry may need to be moved to all of the application's .NET config file on that machine that depend on it.



我希望它有帮助。

关于odp.net-managed - Oracle ODP.NET 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33312848/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com