【问题标题】:odp.net Add-Type error in PowershellPowershell 中的 odp.net Add-Type 错误
【发布时间】:2017-08-10 15:10:13
【问题描述】:

我正在尝试使用 Oracle.ManagedDataAccess.dll 连接到 RHEL 节点上的远程 Oracle 数据库。但是当我尝试使用 Add-Type 引用 dll 时,我得到以下信息:

Add-Type : Could not load file or assembly Oracle.ManagedDataAccessDTC.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

服务器运行在Windows Server 2008R2上,我的Powershell版本是2.0,我的odp.net dll是ODP.NET_Managed12.1.0.2.160719

附加信息:我从 NAS 引用 .dll,该 dll 不在服务器上。

我应该使用什么版本的 odp.net?或者我缺少什么依赖?对此的任何见解将不胜感激。

谢谢!

【问题讨论】:

  • 程序集在哪里?我会假设你有一台 x64 机器?库的架构是什么,运行的 PowerShell 实例的架构是什么?
  • 程序集位于 NAS 上。操作系统是 64 位的。
  • 好的。那么PS和DLL呢?我只是想确定这不是架构不匹配。

标签: .net windows oracle powershell


【解决方案1】:

“这个程序集是由更新的运行时构建的......”

尝试安装新版本的 PowerShell。

使用 PowerShell 5.1 我安装了 .Net 4.5.2 版

但现在我遇到另一个错误“无法加载文件或程序集”...我正在处理它;-)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-15
    • 2011-04-15
    • 1970-01-01
    • 2020-11-10
    • 1970-01-01
    • 2014-10-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多