简体   繁体   English

Visual Studio调试疯狂!

[英]Visual Studio Debugging Madness!

I am having some really weird stuff happening with my co-workers Visual Studio. 我的同事Visual Studio发生了一些非常奇怪的事情。

We are totally stumped and I am just throwing this out there in the hopes that someone has a good idea. 我们完全被难倒了,我只是把它扔到那里,希望有人有个好主意。

Here is the issue: 这是问题:

He has some code that runs on a timer. 他有一些在计时器上运行的代码。 In that timer, he does a lock to ensure that only one "thread" at a time can get in. 在那个计时器中,他lock以确保一次只能有一个“线程”进入。

He puts a break point on a spot inside the lock and runs to that point. 他将一个断点放在lock内的某个点上,然后运行到该点。

This is where the weirdness happens. 这就是奇怪发生的地方。 As he is stepping, the flow will jump him back to that break point after a second or two. 当他踩着时,流动将在一两秒之后将他跳回到那个断点。 It is very confusing. 这很令人困惑。 The thread ID never changes, so it is not a new thread that is getting past the lock somehow. 线程ID永远不会改变,所以它不是以某种方式通过lock的新线程。

But here is the really weird part. 但这是非常奇怪的部分。 It happens every time for him, but when I download the source and try it, it works just fine for me. 它每次都发生在他身上,但是当我下载源代码并尝试它时,它对我来说效果很好。 I can step through all the code and I never get my next statement "jumping around" (for lack of a better word). 我可以逐步完成所有代码,但我从来没有得到我的下一个声明“跳来跳去”(因为没有更好的词)。

The only difference between his machine and mind is that I have Visual Studio 2010 installed and he does not. 他的机器和头脑之间的唯一区别是我安装了Visual Studio 2010而他没有。 (However, we are both running this in Visual Studio 2008 SP1) (但是,我们都在Visual Studio 2008 SP1中运行它)

Any ideas? 有任何想法吗? any at all? 什么都没有? I am really stumped. 我真的很难过。

The first thing that comes to my mind is this hotfix: 我想到的第一件事是这个修补程序:

http://support.microsoft.com/kb/957912 http://support.microsoft.com/kb/957912

And if I remember right from about 2 years ago, installing the Silverlight SDK also fixed the issue. 如果我记得大约2年前,那么安装Silverlight SDK也可以解决此问题。 I remember thinking that was really strange, but it did the trick for me. 我记得当时以为真的很奇怪,但这确实帮了我大忙。 (I actually found that solution before the hotfix) (我实际上在修补程序之前找到了解决方案)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM