Failed to debug XBAP with Visual Studio 2010
Just ported my project to Visual Studio 2010 but the target framework was left at 3.5. The project contains a partial trust XBAP application and many WCF services.
Debugging is configured to run PresentationHost.exe with the -debug and -debugSecurityZoneUrl parameters.
In VS2008 everything works fine and in VS2010 Beta2 (not sure about RC), but in VS2010 RTM debugging doesn't work for some reason. The application starts but does not hit a breakpoint. And if, for example, an exception is thrown, a message box "Do you want to debug or close ..." appears, and after selecting the "debug" option, a new strange message box appears:
---------------------------
Warning
---------------------------
A debugger is attached to PresentationHost.exe but not configured to debug
this unhandled exception. To debug this exception, detach the current debugger.
An unhandled exception was raised from Microsoft .NET Framework v 1.0, 1.1, or 2.0,
but the current debugger is configured to debug Microsoft .NET Framework v4.0 code.
Examine the exception using the SOS tool.
---------------------------
OK
---------------------------
And where is the vaunted multigrip?
Has anyone already faced the same problem?
UPDATE:
Tried debugging the "Start browser from URL" option. Debugging works, but I get a SecurityException. So maybe you just need to figure out how to make it work with the "Start external program" option.
UPDATE2:
Checked that PresentationHost actually loads in both scenarios:
"Run external program" - Latest version (4.0.31106.0) from C: \ Windows \ System32 \
"Launch browser from URL" - old version (3.0.6920.4902) from C: \ Windows \ winsxs \ x86_wpf-presentationhostexe_31bf3856ad364e35_6.1.7600.16385_none_6fca8974817173aa
a source to share
This is a bug in RTM for Visual Studio 2010:
https://connect.microsoft.com/VisualStudio/feedback/details/487949/debugging-external-application
Workaround:
- unplug and plug again - make sure "Attach to" is correct.
- change App.Config EXE:
<configuration> & L; run> <supportedRuntime version = "v2.0.50727" /> & L; / & start gt; </configuration>
a source to share