“无可用来源"发生托管异常时

编程入门 行业动态 更新时间:2024-10-28 20:25:35
本文介绍了“无可用来源"发生托管异常时 - WPF Visual Studio 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

出于某种原因,我的 Visual Studio 2010 没有在我自己的代码中加载调试符号.

for some reason, my visual studio 2010 is not loading debug symbols on my own code.

我正在使用默认的 WPF 应用程序解决方案.使用我正在开发的示例 WPF 应用程序,并在调试模式下运行.

i am using a default WPF application solution. with a sample WPF app i am working on, and running in Debug mode.

当我进入调试阶段时,我可以单步调试我的代码.

when i go into debug, i can step through my code.

但是

当我的代码中发生异常时(即 throw new Exception("test")),visual studio 会给我一个蓝色的空白屏幕,并显示没有可用的源.没有加载符号等等."

when exception happens in my code (i.e. throw new Exception("test")), visual studio gives me the blue blank screen with "No Source Available. No symbols are loaded blah blah.."

我实际上可以查看"异常详细信息,它会告诉我发生异常的代码行.

i can actually "view" exception details, where it will tell me the line of code my exception occured on.

所以它确实知道发生了什么......似乎.

so it does know what happened.. it seems.

似乎认为没有加载PDB文件.

it seems to think that PDB files are not loaded.

我的设置:

options > Deubg > 选中仅启用我的代码(仅限托管)".应用程序属性:在 Debug x86 中运行的 1 个项目

options > Deubg > "Enable just my code (managed only)" is checked. application properties : 1 project running in Debug x86

推荐答案

加载符号应配置在:工具 -> 选项 -> 调试 -> 符号,您可以选择自动加载符号:所有模块"或仅指定模块".这应该设置为所有模块.如果像我一样在 .NET 框架中得到没有可用的源"的异常,你应该点击空符号缓存"按钮.这对我有用.

Loading symbols should be configured on : Tools -> Options -> Debugging -> Symbols where you can choose to Automatically load symbols for: "All modules" or "Only specified modules". This should be set to all modules. If you get "no source available" for exceptions in the .NET framework like I did you should hit the "empty symbol cache" button. This worked for me.

这篇关于“无可用来源"发生托管异常时 - WPF Visual Studio 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-27 11:00:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1154205.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:异常   来源   发生   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!