我想從Powershell引用.net 1.1程序集。我相信我已經嘗試了1.0和2.0,並且我已經在Win XP和Win 7 64位上嘗試過了。從Powershell調用.net 1.1
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
我已經沖刷谷歌爲PowerShell的是否支持1.1或沒有,但無法找到答案。可以?
第二條消息說「檢索LoaderExceptions屬性..」。至於HOW,我絕對沒有任何參考。
你有沒有試過'[System.Reflection.Assembly] :: LoadFrom(「C:\ Your.dll」)'? – 2012-02-23 20:45:13
是的 - 奇怪的是,它的作品。謝謝 – Gwynge 2012-02-25 20:12:26