When things become super freaky do a RebuildAll

I just solved an irritating problem. I had a program sending heartbeats to another, but with the wrong frequency.

Putting in a breakpoint at the point where that frequency is set showed the value at 2000ms, rather than the 5000ms we had in the registry. So I checked the registry reading code was pulling the right value into the appropriate variable, and indeed it was. No other lines of code referred to the member that held this value. There was no way of setting the value other than reading from the registry in this one location. Even putting a breakpoint on change to that variable failed to show what was going on – it never broke on change – although the program did run like a dog with that breakpoint on. Much pulling of hair ensued.

Then I took the opportunity to inspect this. And I noticed, browsing through the various values, that there was a value of 2000 in the preceeding variable.

I then proceeded to use the old adage, “When things become super freaky do a RebuildAll”, and the problem was solved. Seems like there was some sort of link problem. I just wish I’d tried it earlier.