Friday, May 9, 2008

Page_Load called twice

I hate it when the IDE makes code changes that you aren't aware of that could have negative repercussions that you aren't aware of until after deployment to production. I recently upgraded an app from .Net 1.1 to .Net 2.0 and everything seemed fine. Testing showed my calculations were unaffected by the upgrade.

Somehow since then, one or more of my codebehind pages had an additional event added to the Page_Load method. The Handles clause was changed to "Handles Mybase.Load, Me.Load". This had the unfortunate side effect of calling the method twice. One of the methods called in the Page_load method summed some data, but the private member variable where the calculation was stored was initialized to zero outside of the Page_Load method. This caused the sum to be 2X the actual value because the data was summed twice.

When and how was this extra event added? I don't know, but I will be on the lookout for it in the future as it can cause unexpected behavior at the most inopportune time.

Tuesday, May 6, 2008

Vista SP1 Windows Update - hoses my Desktop

I wanted to upgrade my desktop from Business Edition to Ultimate SP1. I attempted to just run the upgrade, but it politely informed me that I needed to install SP1 on my Business Edition first. Well what sounded like a trivial routine task, ultimately rendered my Desktop completely unusable without an Operating System that would boot.
My desktop happened to show that SP1 had been downloaded via the Automatic Windows Update functionality, so all I needed to do was install. I let Windows do the SP1 install and at the end, it said that it was 100% complete. I shut down the PC for the night and the following day when it was restarted, it would not boot Vista in Normal Mode, Safe Mode, or otherwise. The OS decided that I had a "Missing or corrupt ntoskrnl.exe", please insert Vista DVD and repair the installation.
I figured, no problem, I will just run the repair routine which seems unusually common in Windows installations. Much to my dismay, I was presented with an error message to the effect of "This problem cannot be automatically repaired". That's it. Nothing else. Now what? Google, of course. Unfortunately there were thousands of blog posts with the same error message, but none of the suggested "hack" like fixes did any good on my system. Nothing of course from Microsoft.
Fortunately Microsoft is offering free tech support for SP1 issues. I never recieved any response from the contact form (supposedly 24 hour response time). I did get about 1 hour of time from a tech representative on the Chat line. Ultimately the best response I got was I need to completely reinstall Vista, all my programs and data. He did give me information on how to do the reinstall using the custom setting to retain a copy of my data, which was helpful information, but it won't save the 16+ hours it will take to reinstall all my installed programs.
I have not tested it, but there were many references from other upset users to use the 460 Mb standalone SP1 install instead of the poisoned Windows Update version.