C#.NET VS2010断点无法正常工作 [英] C#.NET VS2010 Break-Points Not Working

查看:135
本文介绍了C#.NET VS2010断点无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我去调试代码时,所有的断点都被透明填充(仅保留轮廓),中间带有感叹号的小三角形位于断点的拐角处。

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.

我已采取的步骤:


  1. 清理并重建项目

  2. 将选项运行时,发生构建或部署错误时:设置为不启动

  3. 重新保存项目。

  4. 将项目文件夹从闪存驱动器移至HD

  5. 关闭并重新打开VS2010

  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


推荐答案

我了解您的类已执行,但没有命中断点,并且在生成和运行解决方案时,会在build文件夹中找到一个新创建的程序集。

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.

要弄清VS从何处获取程序集,可以首先在尚未修改的某些类中设置一个断点,因此肯定会命中(例如,在Main的结尾)。命中断点后,在AppDomain.CurrentDomain.GetAssemblies()中查找程序集,然后在其中查找Location属性,该属性应为您提供从中加载程序集的路径。

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.

这篇关于C#.NET VS2010断点无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆