How to debug a published XBAP file in VS2010?

I need to debug the application with full trust, either by specifying the URL, or, ideally, from the web application where I intend to deploy it. I tried the following:

  • Running "PresentationHost.exe -embedding" from the command line using Visual Studio. The IDE shows that my breakpoints are valid until I actually try to load the .xbap file, after which it shows that there are no characters loaded. None of my control points hit. I tried "mage -cc" before doing this in a few recommendations elsewhere.

  • The hard-coded URL in the Debug panel of the project, then F5. Alternatively, "PresentationHost.exe -embedding -debug" and attach to the process, load .xbap into IE. As a result, the following error appears:

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(...)
+5
source share
2 answers

Found. "PresentationHost.exe -embedding" will work as long as you select the .pdb file to be published, and this is not the default. This follows from what I saw before, when the debugger did not seem to have characters, and not after loading the application. To clarify:

  • Click the Publish tab in the project properties.
  • Click "Application Files ..."
  • " "
  • .pdb , .
  • REPUBLISH
  • PresentationHost.exe -embedding
  • - xbap, .
+4

, , System.Diagnostics.Debugger.Launch(); . VS , XBAP.

+2

All Articles