无法在powershell中加载System.Windows.Controls程序集

时间:2017-08-25 19:49:44

标签: powershell powershell-v2.0 powershell-v4.0

我一直在尝试使用命令在powershell中加载程序集,如下所示:

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Controls")

它无法正常工作。

enter image description here

1 个答案:

答案 0 :(得分:1)

Wells已经装好了。

尝试运行此功能。

$ExportedTypes = [appdomain]::CurrentDomain.GetAssemblies() | select ExportedTypes
Foreach($ExportedType in $ExportedTypes){
    $ExportedType.ExportedTypes | ?{$_.FullName -like "system.windows.controls*"} | select FullName, Module
}

如果你得到任何结果,它已经加载了。

您正在加载的程序集实际上是PresentationFramework.dll

的一部分