【发布时间】:2012-02-26 04:53:51
【问题描述】:
我正在尝试从 Powershell 引用一个 .net 1.1 程序集。我相信我已经尝试过 1.0 和 2.0,并且我已经尝试过 Win XP 和 Win 7 64 位。
add-type -path "path-to-dll"
然后我得到以下错误:
Add-Type : Unable to load one or more of the requested types. Retrieve
the LoaderExceptions property for more information. At line:1 char:9
+ add-type <<<< -path "C:\Program Files\Propel Systems\Cimera eval\cimera common.dll"
+ CategoryInfo : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
+ FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeCommand
我在 Google 上搜索过 Powershell 是否支持 1.1,但找不到答案。是吗?
其次,消息说“检索 LoaderExceptions 属性..”。但我在任何地方都找不到关于如何做的参考。
【问题讨论】:
-
你试过
[System.Reflection.Assembly]::LoadFrom("C:\Your.dll")吗? -
是的 - 奇怪的是,它有效。谢谢
标签: .net powershell