C# VS2008 SP1 如何解决单步问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23078/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-01 09:11:33  来源:igfitidea点击:

How to solve the Single stepping problem with VS2008 SP1

提问by Napco

Debugging in visual studio seems to have been broken with sp1. Single stepping randomly does not work and just starts to run. Sometimes breakpoints are ignored. It is unpredictable and unusable. It will generally hit the first break point but after that it is totally unpredictable.

在 Visual Studio 中的调试似乎已经被 sp1 破坏了。单步随机不起作用,只是开始运行。有时断点会被忽略。它是不可预测和无法使用的。它通常会达到第一个断点,但之后就完全不可预测了。

Any idea what needs to be done to correct this behavior ?

知道需要做什么来纠正这种行为吗?

回答by Coincoin

Make sure you are debuging using the debug configuration, not the release one. Also make sure optimizations are disabled in debug configuration.

确保您正在使用调试配置进行调试,而不是发布配置。还要确保在调试配置中禁用优化。

Optimizations must be off when you debug else it can lead to very erratic behaviours like these.

调试时必须关闭优化,否则会导致非常不稳定的行为。



For C# projects, which I am assuming the question is about looking at the tags, the optimization option would be located in the "Build" tab of "Project > Properties..." Last option of "General" it's called "Optimize Code".

对于 C# 项目,我假设问题是关于查看标签,优化选项将位于“项目 > 属性...”的“构建”选项卡中,“常规”的最后一个选项称为“优化代码” .

回答by Napco

We are using c# as a language.

我们使用 c# 作为语言。

The problem has been identified by microsoft.

该问题已被微软发现。

quote from forums:

论坛引用:

We have identified the root cause of this issue and are currently working on a solution. We apologize for the inconvenience that this is causing you. We will let you know as soon as we have a solution. In the mean time, if we discover any workrounds, we will post them here.

我们已经确定了此问题的根本原因,目前正在寻找解决方案。对于由此给您带来的不便,我们深表歉意。我们会在找到解决方案后立即通知您。同时,如果我们发现任何变通方法,我们会将它们张贴在这里。

回答by ?eljko Tanovi?

There is a fix which for some reason isn't included in the update process:

有一个修复程序由于某种原因未包含在更新过程中:

http://code.msdn.microsoft.com/KB957912/Release/ProjectReleases.aspx?ReleaseId=1796

http://code.msdn.microsoft.com/KB957912/Release/ProjectReleases.aspx?ReleaseId=1796

It worked for me although some people say they still have the same problem.

它对我有用,尽管有些人说他们仍然有同样的问题。