Unable to debug XBAP with Visual Studio 2010
Just migrated my project to Visual Studio 2010, but target framework was left 3.5. Project contains an XBAP app in partial trust and a bunch of WCF services.
Debugging is configured to start PresentationHost.exe with -debug and -debugSecurityZoneUrl parameters.
Under VS2008 everything works fine, and in VS2010 Beta2 (don't sure about RC), but under VS2010 RTM debugging is for some reason doesn't working. Application runs, but doesn't hit any breakpoint. And if for example exception occurs, message box appears "Do you wish to debug or close..." and after I choose "debug" option new weird 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 multitargeting?
Did anyone have already bumped into same issue?
UPDATE:
Tried to debug with "Start browser with URL" option. Debugging is working, but I get SecurityException. So it is possible, just need to figure out how to make it work with "Start external program" option.
UPDATE2:
Checked what PresentationHost is actually loads in both scenarios:
"Start external program" - Latest version (4.0.31106.0) from C:\Windows\System32\
"Start browser with UR开发者_运维技巧L" - Old version (3.0.6920.4902) from C:\Windows\winsxs\x86_wpf-presentationhostexe_31bf3856ad364e35_6.1.7600.16385_none_6fca8974817173aa
This is a bug in Visual Studio 2010 RTM:
https://connect.microsoft.com/VisualStudio/feedback/details/487949/debugging-external-application
Workaround:
- detach, and re-attach - make sure "Attach to" is specified correctly.
- modify App.Config of the EXE:
<configuration> <startup> <supportedRuntime version="v2.0.50727" /> </startup> </configuration>
精彩评论