How do I debug a published XBAP file in VS2010?

二次信任 提交于 2019-12-04 07:03:54

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:

  • Go into the Publish tab on the project properties
  • Click "Application Files..."
  • Check "Show all files"
  • Select the .pdb file for the executable to be included.
  • Republish
  • PresentationHost.exe -embedding
  • Attach to process or set the project to run this out of the debug tab
  • Launch the web page in a browser and navigate to the xbap file, breakpoints should be hit now.

If you have access to source code and you deploy on localhost you can simply add System.Diagnostics.Debugger.Launch(); in your code. This will allow You to attach with VS to any process your XBAP is using.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!