无法使用ReflectionOnlyLoadFrom

时间:2017-10-26 14:55:34

标签: oracle powershell reflection

嗯......我遇到了需要连接到Oracle数据库的第三方应用程序的问题。问题是“Oracle.DataAccess”库无法加载。

制造商告诉我在powershell中运行以下命令:

$path="D:\oracle\product\11.2.0\client_1\odp.net\bin\4\Oracle.DataAccess.dll"
[Reflection.Assembly]::ReflectionOnlyLoadFrom($path).ImageRuntimeVersion

这应该返回正在使用的框架版本。这不起作用并抛出以下消息:

Exception calling "ReflectionOnlyLoadFrom" with "1" argument(s): "Could not loa d file or assembly 'file:///D:\oracle\product\11.2.0\client_1\odp.net\bin\4\Ora cle.DataAccess.dll' or one of its dependencies. This assembly is built by a run time newer than the currently loaded runtime and cannot be loaded." At line:1 char:46
+ [Reflection.Assembly]::ReflectionOnlyLoadFrom <<<< ($path).ImageRuntimeVersio n
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

此服务器正在运行W2008 Server R2。奇怪的是,在我运行W2012服务器的另一台机器上,这件事情很好。 我已经安装并修复了所有可能的.net框架版本。

有人可以帮我这个吗?。

0 个答案:

没有答案