2015-08-09 70 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]

相關問題