EDIT: When I run this code in Visual Studio 2013, the debugger is showing Utc
, not Local
. It's a bug in Visual Studio 2015 Debugger.
EDIT: Have taken the code and put in stand-alone console app, but cannot reproduce in either version of VS. Bummer.
Can someone explain to me how what you see in this screenshot is possible?!
endingTimePeriodStartDate
is redefined as its Date
value but set to DateTimeKind.Utc
.endingTimePeriodStartDate
is not actually DateTimeKind.Utc
, an exception is thrown.endingTimePeriodStartDate.Kind == DateTimeKind.Utc
System.Diagnostic.Debug.WriteLine(endingTimePeriodStartDate.Kind)
before line 305 and it prints “Utc” in the Output window).endingTimePeriodStartDate
in the Locals and Watch debugger windows, and when I mouse hover over the variable, the Kind
property shows DateTimeKind.Local
Usually the debugger will show wrong line numbers, and go into old code if it is running a different version of the dll (a former version) than the one that your code is showing. This happens
Usually to fix this, you should:
(Start by trying only a "clean" and "rebuild")
Check if this fixed the problem.
5.1 If your afraid, backup your whole source directory. After everything works, delete the backup...
5.2 manually go into the dependent projects (that are referenced in your "wrong code showing" project) and in each one of them, go into the obj and into the bin folder and delete everything that was automatically created from there - in other words, everything that you did not put there manually. Usually that's everything. Don't worry, visual studio will re-create the Debug and Release directories and fill them up.
Delete the obj and bin of your project as well.
Rebuild everything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With