无法使用 Visual Studio 2010 调试 XBAP

发布于 2024-08-28 12:20:08 字数 1239 浏览 0 评论 0 原文

刚刚将我的项目迁移到 Visual Studio 2010,但目标框架保留为 3.5。项目包含一个部分信任的 XBAP 应用程序和一堆 WCF 服务。

调试配置为使用 -debug 和 -debugSecurityZoneUrl 参数启动PresentationHost.exe。

在VS2008下一切正常,在VS2010 Beta2中(不确定RC),但在VS2010 RTM下调试由于某种原因不起作用。应用程序运行,但没有遇到任何断点。例如,如果发生异常,消息框会出现“您希望调试还是关闭...”,在我选择“调试”选项后,会出现新的奇怪消息框:

---------------------------
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   
---------------------------

所吹嘘的多目标在哪里?

有人已经遇到过同样的问题吗?

更新:

尝试使用“使用 URL 启动浏览器”选项进行调试。调试正常,但我收到 SecurityException。所以这是可能的,只需要弄清楚如何使其与“启动外部程序”选项一起工作。

UPDATE2:

检查了PresentationHost在两种情况下实际加载的内容:

“启动外部程序” - 来自C:\ Windows \ System32 \的最新版本(4.0.31106.0)

“使用URL启动浏览器” - 来自C:的旧版本(3.0.6920.4902) \Windows\winsxs\x86_wpf-presentationhostexe_31bf3856ad364e35_6.1.7600.16385_none_6fca8974817173aa

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 URL" - Old version (3.0.6920.4902) from C:\Windows\winsxs\x86_wpf-presentationhostexe_31bf3856ad364e35_6.1.7600.16385_none_6fca8974817173aa

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亣腦蒛氧 2024-09-04 12:20:08

这是 Visual Studio 2010 RTM 中的错误:

https:// connect.microsoft.com/VisualStudio/feedback/details/487949/debugging-external-application

解决方法:

  • 分离并重新附加 - 确保正确指定“附加到”。
  • 修改EXE的App.Config:

<配置>
<启动>

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>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文