Have I gone mad? I've always been able to trust the debugger right?
Turns out that during a debugging session with VS2015, when I for example change the value of a variable in the Immediate Window, then that assignment results in a "garbage" value being assigned. It's the same garbage value every time, but completely wrong nonetheless.
I've distilled this down to the simplest console application repro, and just in case you might think to concur with my self-assessment of madness, I've also made a screenshot video clip of it going awry.
Are you guys getting this issue too or is this a local machine issue?
Here are the one drive links for:
- Video Clip of repro
- Source code for repro (very small - main class code below)
PS: I'm running Windows 10 Enterprise x64, VS2015 Enterprise with all current updates for OS and VS applied. The underlying hardware is modern hardware that I've had no issue with under 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 );
}
}
I'll start to put together the same for a VS Connect issue.
EDIT: I'm beginning to wonder whether this is an issue just for me as no-one has confirmed that this is happening for them too.
EDIT: The connect issue has been filed here.