更新:2007 年 11 月
Windows Presentation Foundation (WPF) 主机 (PresentationHost.exe) 是一个应用程序,它使 WPF 应用程序可承载于兼容浏览器(包括 Windows Internet Explorer 7 和 Microsoft Internet Explorer 6)中。在默认情况下,Windows Presentation Foundation (WPF) 主机注册为浏览器承载的 WPF 内容的外壳程序和 MIME 处理程序,包括:
松散(未编译)XAML 文件 (.xaml)。
XAML 浏览器应用程序 (XBAP) (.xbap)。
对于这些文件类型,Windows Presentation Foundation (WPF) 主机:
启动注册的 HTML 处理程序来承载 Windows Presentation Foundation (WPF) 内容。
加载所需公共语言运行时 (CLR) 和 Windows Presentation Foundation (WPF) 程序集的正确版本。
确保部署所在区域具有适当的权限级别。
本主题介绍了可以与 PresentationHost.exe 一起使用的命令行参数。
用法
PresentationHost.exe [parameters] uri|filename
参数
参数 |
说明 |
|---|---|
文件名 |
要激活的文件的路径,也可以为 URI。 |
-debug |
当激活应用程序时,请勿从存储区中提交或运行它。此限制仅在激活本地文件时起作用。 |
-debugSecurityZoneURL <url> |
与 URL 值一起用来向 PresentationHost.exe 表明:由于将应用程序视为是从指定的 URL 部署的,因此应该调试该应用程序。这将确定部署区域和原始站点。 |
-embedding |
OLE 需要该参数。如果指定了 -event 或 -debug 参数,则不必指定 -embedding 参数,因为该参数已在内部设置。 |
-event <事件名> |
打开具有此名称的事件,并在 PresentationHost.exe 初始化并准备承载 WPF 内容时向该事件发出信号。如果打开事件时发生错误(如该事件还未创建),则 PresentationHost.exe 将终止。 |
方案
外壳处理程序
PresentationHost.exe example.xbap
MIME 处理程序
PresentationHost.exe -embedding example.xbap
Visual Studio 调试
PresentationHost.exe -debug example.xbap
在区域中进行 Visual Studio 调试
PresentationHost.exe -debug -debugSecurityZoneURL http://www.example.com example.xbap