Edit: I just tried this with VS 2010 and the problem did not occur. The problem only occurs with VS 2012. Could this be a mistake? This also happens on two separate laptops and even on another laptop (which just received the latest code).
Firstly, a screenshot of the problem. This method is new code.

The debugger skips the code from my last registration. The comments in the code below explain what happens when I debug this method. Therefore, one really does not need to try to understand the code; just notice that the lines of code are skipped. If you think the code does not match the debug build, please bear with me. You will see where the debugger recognizes the new code, but not the existing code. And this behavior occurs on two different laptops, after deleting the code on the disk and receiving the latter. Each comment tells you if the debugger is deleting a line.
[TestMethod()] [DeploymentItem("PrestoCommon.dll")] public void ApplicationShouldBeInstalledTest_UseCase9() { // Debugger hits this line ApplicationServer appServerAccessor = new ApplicationServer(); // Debugger does not hit these next two lines PrivateObject privateObject = new PrivateObject(appServerAccessor); ApplicationServer appServer = ApplicationServerLogic.GetByName("server10"); // Debugger hits this line. Weirdness: both objects are null, and after this line runs, // appServerAccessor is no longer null. appServerAccessor.Id = appServer.Id; // Skips this line ApplicationWithOverrideVariableGroup appWithValidGroup = appServer.ApplicationsWithOverrideGroup[0]; // Debugger hits this line, but F11 doesn't take me into the method. appWithValidGroup.CustomVariableGroup = CustomVariableGroupLogic.GetById("CustomVariableGroups/4"); // Skips this line Assert.AreEqual(true, true); }
Disassembly shows only those lines of code that really fall.

Now, check it out. If I add a new line of code, the debugger will recognize it, and other lines of code will change as far as it is recognized by the debugger. Only the second line of code, inside the method, is new.
[TestMethod()] [DeploymentItem("PrestoCommon.dll")] public void ApplicationShouldBeInstalledTest_UseCase9() { // Debugger hits this line ApplicationServer appServerAccessor = new ApplicationServer(); // New line. It recognized by the debugger, and it shows up in the disassembly. if (DateTime.Now > DateTime.Now.AddHours(1)) { return; } // Debugger does not hit these next two lines PrivateObject privateObject = new PrivateObject(appServerAccessor); ApplicationServer appServer = ApplicationServerLogic.GetByName("server10"); // Gets hit now. // Debugger hits this line. Weirdness: both objects are null, and after this line runs, // appServerAccessor is no longer null. appServerAccessor.Id = appServer.Id; // No longer gets hit. // Skips this line (now it getting hit) ApplicationWithOverrideVariableGroup appWithValidGroup = appServer.ApplicationsWithOverrideGroup[0]; // Debugger hits this line, but F11 doesn't take me into the method. Now this gets skipped. appWithValidGroup.CustomVariableGroup = CustomVariableGroupLogic.GetById("CustomVariableGroups/4"); // Skips this line. Still skipped. Assert.AreEqual(true, true); }
And here is a partial snapshot of the disassembly showing a new line of code:

How can this happen?
Adding to strangeness, at some point it even came back:
if (DateTime.Now > DateTime.Now.AddDays(1)) { return; }
Things I tried:
- Delete the source code from the hard drive and get the latest version - Repair VS 2012
- Make VS VS clean-up
- Use VS 2010, change the code, register, get the latest version of VS 2012
- Reboot
- Other (I do not remember everyone)