[英]C#.NET VS2010 Break-Points Not Working
When I go to debug my code all my breakpoints are transparently filled (leaving only the outline) and a small triangle with an exclamation point in the middle is in the corner of the break-point.当我 go 调试我的代码时,我的所有断点都被透明填充(只留下轮廓),中间有一个感叹号的小三角形位于断点的角落。
The error when I hover over the break-point is 'The break-point will not currently be hit.当我 hover 超过断点时的错误是'断点当前不会被命中。 The source code is different from the original version.'源代码与原始版本不同。
I had not tried to debug my code in over an hour, and during that time I added a new class with multiple threading functions.我已经有一个多小时没有尝试调试我的代码了,在那段时间里,我添加了一个具有多线程功能的新 class。
Steps I have taken:我已采取的步骤:
I had the same problem and it was because VS2010 was not generating debug symbols.我遇到了同样的问题,这是因为 VS2010 没有生成调试符号。 I had inadvertently changed a setting whiel trying to analyze a dump file.我在尝试分析转储文件时无意中更改了设置。 I was able to fix it this way:我能够以这种方式修复它:
I understand that your class is executed, but the breakpoints are not hit, and that when you build and run your solution, you find a newly created assembly in your build folder.我了解您的 class 已执行,但未命中断点,并且当您构建并运行解决方案时,您会在构建文件夹中找到一个新创建的程序集。
To find out where VS is taking your assembly from you could first of all set a breakpoint in some class you have not modified, so it will certainly be hit (eg at the end of your Main).要找出 VS 从您那里获取您的程序集,首先可以在您尚未修改的一些 class 中设置一个断点,因此它肯定会被命中(例如在您的 Main 末尾)。 When the breakpoint is hit look for your assembly in AppDomain.CurrentDomain.GetAssemblies(), and here look for the Location property which should give you the path your assembly has been loaded from.当断点被击中时,在 AppDomain.CurrentDomain.GetAssemblies() 中查找您的程序集,并在此处查找应该为您提供程序集加载路径的 Location 属性。
I got the same error and solved with the help of this link http://www.codeproject.com/Questions/248735/There-is-no-Source-code-available-for-the-current我遇到了同样的错误并在此链接http://www.codeproject.com/Questions/248735/There-is-no-Source-code-available-for-the-current的帮助下解决了
Go to Tools ---> Options --->Debugging ---> General ---> Uncheck "Require source file to exactly match the original version" ---> click ok. Go 到工具--->选项--->调试--->常规--->取消选中“要求源文件与原始版本完全匹配”--->点击确定。 This works for VS 2010这适用于 VS 2010
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.