【发布时间】:2015-11-01 07:27:59
【问题描述】:
我疯了吗?我一直都能够信任调试器,对吗?
事实证明,在与 VS2015 的调试会话期间,例如,当我在即时窗口中更改变量的值时,该分配会导致分配一个“垃圾”值。每次都是相同的垃圾值,但完全错误。
我已将其提炼为最简单的控制台应用程序重现,以防你可能会同意我对疯狂的自我评估,我还制作了它出错的屏幕截图视频剪辑。
你们是不是也遇到了这个问题,还是本地机器的问题?
这是一个驱动链接:
- Video Clip of repro
- Source code for repro(非常小——主要类代码如下)
PS:我正在运行 Windows 10 Enterprise x64、VS2015 Enterprise,并应用了操作系统和 VS 的所有当前更新。底层硬件是现代硬件,我在 VS2013 下没有任何问题。
internal class Program
{
private static DateTime? _nullableDateTime;
private static void Main( string[] args )
{
// Use the debugger to step through this repro.
// * Not sure if it matters, but I started with F11 right from the start without any breakpoints.
// ==============================================================================================
// 1. Variable starts off with default of null
// The following statement will confirm that with an "empty" value in the console window
Console.WriteLine( _nullableDateTime );
// 2. The next statement assigns the current date and time
_nullableDateTime = DateTime.Now;
// 3. The following statement will confirm the correct value in the console window
Console.WriteLine( _nullableDateTime );
// 4. THIS IS WHERE THE TROUBLE STARTS
// Now, using the immediate window, change the value of the variable with the
// following statement (after the colon) : _nullableDateTime = DateTime.Now
//
//
//
// 5. After changing the value via the immediate window, let's look at it's value now.
// For me (as can be seen in the video), I get the completely wrong value in the console window.
Console.WriteLine( _nullableDateTime );
}
}
我将开始为 VS Connect 问题整理相同的内容。
编辑:我开始怀疑这是否只是我的问题,因为没有人证实这也发生在他们身上。
编辑:连接问题已提交here。
【问题讨论】:
-
源代码似乎很小。最好将代码添加到您的问题中。
-
我会买那个,类似于this one。我们无法为您修复该错误,您必须与 Microsoft 联系。使用 Connect 而不是 SO。
-
谢谢大家 - 会做(添加代码和文件问题与连接)
-
也为您的连接问题添加了评论。
-
我遇到了完全相同的问题。 Visual Studio 2015 中的错误。我现在不能信任 Visual Studio。这太可悲了。
标签: visual-studio-2015 visual-studio-debugging corruption