如何在VS2010中调试已发布的XBAP文件? [英] How do I debug a published XBAP file in VS2010?

查看:76
本文介绍了如何在VS2010中调试已发布的XBAP文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过指定URL或理想情况下从打算将其部署到的Web应用程序中调试完全信任的应用程序.我尝试了以下方法:

I need to debug a full-trust application either by specifying a URL or, ideally, from within the web app I am intending to deploy it to. I've tried the following:

  • 运行"PresentationHost.exe -embeddding";从命令行开始,通过Visual Studio附加.IDE会显示我的断点有效,直到我实际尝试加载.xbap文件为止,此时它表明没有加载任何符号.我的断点都没有命中.我已经尝试过"mage -cc"然后再根据其他地方的一些建议进行操作.

  • Running "PresentationHost.exe -embedding" from the command-line, attaching through Visual Studio. The IDE shows that my breakpoints are valid until I actually attempt to load the .xbap file, at which point it shows that there are no symbols loaded. None of my breakpoints are hit. I've tried "mage -cc" before doing this per several recommendations elsewhere.

在项目的调试"面板中按硬编码的URL,然后按F5.或者,"PresentationHost.exe-嵌入-调试"并附加到进程,然后在IE中加载.xbap.出现页面时,两者均导致以下错误:

Hard-coded URL in the project's Debug panel then F5. Alternatively, "PresentationHost.exe -embedding -debug" and attach to process then load the .xbap in IE. Both result in the following error when the page appears:

System.ArgumentException:不支持URI格式.

System.ArgumentException: URI formats are not supported.

   at System.IO.Path.NormalizePath(...)
   at System.IO.FileStream.Init(...)
   at System.IO.FileStream..ctor(...)
   at System.Windows.Interop.ApplicationLauncherXappDebug.GetIdFromManifest(...)
   at System.Windows.Interop.ApplicationLauncherXappDebug.GetApplicationIdentity()
   at System.Windows.Interop.ApplicationLauncherXappDebug.Initialize()
   at System.Windows.Interop.DocObjHost.MS.Internal.AppModel.IBrowserHostServices.Run(...)

推荐答案

找到了它.只要您选择要发布的.pdb文件(默认情况下未启用),"PresentationHost.exe -embedding"将起作用.这是从我之前看到的结果得出的,一旦应用程序实际加载,调试器似乎就带有符号,而没有符号.要澄清:

Found it. The "PresentationHost.exe -embedding" will work, provided that you select the .pdb file to be published, which it is not by default. This follows from what I saw before, where the debugger appeared to have symbols then not, once the app actually loaded. To clarify:

  • 进入项目属性上的发布"标签
  • 单击应用程序文件..."
  • 选中显示所有文件"
  • 选择要包含的可执行文件的.pdb文件.
  • 重新发布
  • PresentationHost.exe-嵌入
  • 附加到处理或设置项目以在调试"选项卡之外运行该项目
  • 在浏览器中启动网页并导航到xbap文件,现在应该命中断点.

这篇关于如何在VS2010中调试已发布的XBAP文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆