C#.NET VS2010 Break-Points Not Working

北慕城南 提交于 2019-12-08 20:22:56

问题


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.

The error when I hover over the break-point is 'The break-point will not currently be hit. 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.

Steps I have taken:

  1. Clean and rebuild project
  2. Set option 'On Run, when build or deployment errors occur:' to 'Do not launch'
  3. Re-save project.
  4. Move project folder off of flash drive and onto HD
  5. Close and reopen VS2010

回答1:


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.

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 (e.g at the end of your 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.




回答2:


I had the same problem and it was because VS2010 was not generating debug symbols. I had inadvertently changed a setting whiel trying to analyze a dump file. I was able to fix it this way:

  1. From the Tools menu, select Options
  2. In the Debugging Section select the Symbols dialogue
  3. At the bottom, under Automatically load symbols for select All modules, unless excluded
  4. click the Specify excluded modules link and make sure the list is empty.



回答3:


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




回答4:


Go to Tools ---> Options --->Debugging ---> General ---> Uncheck "Require source file to exactly match the original version" ---> click ok. This works for VS 2010



来源:https://stackoverflow.com/questions/7020624/c-net-vs2010-break-points-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!