oracle - "Test connection succeeded"但 "An unexpected error occurred in the ODP.NET, Managed Driver"

标签 oracle visual-studio visual-studio-2015 odp.net odp.net-managed

我想从 Visual Studio 2015 Enterprise Update 3 连接 Oracle。 安装 ODT For Visual Studio 2015 后,添加与数据提供程序 Oracle 数据库(ODP.NET 托管驱动程序)的新连接弹出窗口似乎很奇怪,即使使用空连接字符串 - 添加 ss- 测试连接也会成功,并且当按“确定”时,会发生意外错误。

64位机器,卸载ODAC,修复Visual studio 2015并安装ODT for vs 2015。

感谢和问候,

error

最佳答案

更新2019年11月22日

大家好,

在浪费了数小时(也可能是数年)尝试使用 Visual Studio 解决 Oracle 问题后,我发现如果安装了 VS2017 和 VS2019 并且重新安装了 ODTforVSXXX,在我的例子中是 ODTforVS2017_122011.exe,安装程序会添加以下中的所有设置最新 Visual Studio 的文件“devenv.exe.config”,在本例中为 VS2019。要解决该错误,您必须将这些设置从“devenv.exe.config”(2019)复制到“devenv.exe.config”(2017)。

<dependentAssembly>
    <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
    <codeBase version="4.122.1.0" href="c:\program files (x86)\oracle developer tools for vs2017\odp.net\managed\common\oracle.manageddataaccess.dll" />
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Oracle.ManagedDataAccess.EntityFramework" publicKeyToken="89b483f429c47342" culture="neutral" />
    <codeBase version="6.122.1.0" href="c:\program files (x86)\oracle developer tools for vs2017\odp.net\managed\common\ef6\oracle.manageddataaccess.entityframework.dll" />
</dependentAssembly>

<system.data>
      <DbProviderFactories>
         <remove invariant="Oracle.ManagedDataAccess.Client" />
      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
        <remove invariant="Microsoft.SqlServerCe.Client" />
        <remove invariant="Microsoft.SqlServerCe.Client.3.5" />
        <remove invariant="Microsoft.SqlServerCe.Client.4.0" />
        <add name="Microsoft SQL Server Compact 4.0 Client Data Provider" invariant="Microsoft.SqlServerCe.Client.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact 4.0 Client" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
      </DbProviderFactories>
    </system.data>

我希望它能有所帮助。 干杯!

关于oracle - "Test connection succeeded"但 "An unexpected error occurred in the ODP.NET, Managed Driver",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45310536/

相关文章:

oracle - 按子句连接以获得层次结构的顶部

visual-studio - Visual Studio 2013 IDE 响应缓慢

visual-studio - 更改 Visual Studio 2015 键绑定(bind)

visual-studio-2015 - 代码分析错误未出现在 VS2015 Update1 的错误列表中

oracle - 如何在Oracle中找到命名约束的定义?

sql - oracle next_day函数使用天数

visual-studio - 为什么在运行我的应用程序时会遗漏一些引用?

visual-studio-2015 - Visual Studio 2015不显示“错误列表”窗口

oracle - 在 PL/SQL 中验证 IBAN

c++ - 替代 C/C++ localtime()