本文介绍了调试 WPF 应用程序中托管的 XBAP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有多个选项卡的 WPF 应用程序(比如 WPF.exe).在其中一个选项卡中,我使用以下方式显示 *.xbap:WebBrowser 标记.

I have a WPF Application (say, WPF.exe) with multiple tabs. In one of the tabs, I display a *.xbap using: WebBrowser tag.

<WebBrowser Source="c:/PublishedWebSites/Test.xbap"/>

当我启动 WPF.exe 时,我可以将调试器附加到任何其他 UserControl,但不能附加到我的 XBAP.我还尝试将我的 XBAP 附加到 PresentationHost.exe 进程,该进程在我单击浏览器选项卡时启动.

When I start WPF.exe, I am able to attach debugger to any other UserControl but not to my XBAP. I also tried attaching my XBAP to PresentationHost.exe process which was started when I click on the browser tab.

在 XBAP 项目中未命中断点,但我验证了在发布 XBAP 时,我也会发布 *.pdb 文件.

The break points are not hit in XBAP project, though I verified that when I publish the XBAP, I oublish *.pdb files as well.

谁能告诉我我在这里做错了什么?

Could anyone tell me what I am doing wrong here?

谢谢,RDV.

推荐答案

我可以调试.脚步:1. 编译和发布 XBAP.发布后不要更改任何内容.. 万一你做.. 重新发布它.2. 确保没有 PresentationHost.exe 进程在运行.3. 运行 WPF 应用程序.启动 XBAP(作为选项卡之一......在我的情况下).4. Debug->Attach to process-> Connect to PresentationHost.exe=> 确保你选择了正确的 32 vs 64 版本(我认为这是我的错误).

I could debug. Steps:1. Compile and Publish XBAP. DO NOT change anything after publishing.. in case you do.. republish it.2. Ensure there are no PresentationHost.exe processes running.3. Run the WPF application. Launch XBAP (as one of the tabs ..in my case).4. Debug->Attach to process-> Connect to PresentationHost.exe=> ensure that you select the correct 32 vs 64 version (i think this was my mistake).

谢谢,RDV

这篇关于调试 WPF 应用程序中托管的 XBAP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-16 04:35