【发布时间】:2010-12-05 08:10:56
【问题描述】:
我尝试使用 Add-Type 构建 WPF 应用程序,但失败了。
$a = @'
使用 System.Windows;
公开课课程
{
[STAThread()]
公共静态 void Main(string[] args)
{
应用程序 = 新应用程序();
Window1 w = new Window1();
应用程序运行(w);
}
}
'@
添加类型 -TypeDefinition $a -UsingNamespace "System.Windows"
Add-Type 的帮助文档没有使用 -UsingNamespace(和 -ReferencedAssemblies), 所以我不太明白...
【问题讨论】:
标签: wpf powershell powershell-2.0