2015-08-09 69 views
6

我疯了吗?我一直都能够相信调试器吗?Visual Studio 2015调试器损坏 - 它是一个错误还是只是我?

原来,在与VS2015进行调试会话期间,例如,当我在立即窗口中更改变量的值时,该赋值会导致分配“垃圾”值。每次都是相同的垃圾值,但是完全错误。

我已经完成了这个最简单的控制台应用程序repro,以防万一你可能会认为我同意我的疯狂自我评估,我也做了一个错误的截图视频剪辑。

你们是否也遇到了这个问题,或者这是本地计算机问题?

这里有一个驱动器链接:

PS:我运行Windows 10企业版x64, VS2015 Enterprise具有适用于OS和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连接问题。

编辑:我开始怀疑这是否仅仅是一个问题,因为没有人确认这种情况也发生在他们身上。

编辑:连接问题已提交here

+2

源代码看起来非常小。最好将代码添加到您的问题中。 – MicroVirus

+0

我会买,类似[这一个](http://stackoverflow.com/questions/31311813/quickwatch-is-not-work-correctly-for-showing-nullable-properties-tostring)。我们无法为您修复该错误,您必须与微软通话。使用连接而不是SO。 –

+0

感谢所有人 - 会做(连接时添加代码和文件问题) – Jaans

回答

4

我可以证实,类似发生在我安装Visual Studio 2015年 我也跑在Visual Studio 2013中相同的代码(幸运的是我没有卸载的时候我升级),并且它不存在发生的:

v2013 vs 2015

所以,好像你刚刚发现了Visual Studio 2015中的错误(我的机器正在运行Windows 7 Pro,所以这不是Windows 10的问题)。不幸的是我缺乏专​​业知识来评论你的心理健康,所以不要在这方面做出假设:-)

1

类似的问题在这里。只要看看类和面向.NET 3.5

public class DoSomething 
{ 
    public void Makeit() 
    { 
    // Set Breakpoint here 
     SortedList<string, string> sortedList = new SortedList<string, string>(); 
     sortedList.Add("test", "1"); 
     sortedList.Add("test2", "2"); 
     //when breakpoint hits, uncomment the next line and press F5 
     //sortedList.Add("test4", "5"); 
//Exception 


class Program 
{ 
    static void Main(string[] args) 
    { 
     TestLibrary.DoSomething bla = new TestLibrary.DoSomething(); 

     bla.Makeit(); 
    } 
} 

[animated explanation]

相关问题