Updating the drivers did not solve the problem and we were back to the machine Event log, where we noticed the following entry (Event 1001, name CLR20r3):
The machine did not have VS installed so we tried hooking-up the command line debugger (MDbg.exe) from the .NET SDK and the following exception was thrown:
Cannot convert string in attribute 'EndPoint' to object of type 'System.Windows.Point'. Premature string termination encountered. Error at object 'System.Windows.Media.LinearGradientBrush' in markup file '...;component/wpfwindow.xaml' Line 20 Position 34."
Puzzled. The same code worked as a breeze on another machine with the same hardware (at least the graphics subsystem) and we started comparing the settings, installed apps, updates, etc. The part of the message saying "Premature string termination encountered" indicated that something is wrong with the way the XAML is parsed and probably the delimiter cases were wrong. But the regional settings were set to US English and there was nothing unusual. Trying to change the list separator made no difference. Then, the guy remembered that he wanted to test certain functionality on his machine as reported by the customer, so he played with regional settings trying to reproduce the bug. Result was devastating: not just that he almost got the machine cleaned and paved with the fresh Vista installation, but he was also not able to help the customer asking for a totally different thing.
Googling the problem revealed the following MS KB entry:
FIX: An exception in the XAML parser is thrown when you run a WPF application on a computer that has customized English (United States) regional settings
Obviously, resetting the settings (changing to 'UK English' and then back to 'US English') did solve the problem, and luckily, we did not yet have reports from customers about similar situations. The link above states that the fix can be obtained if the "MS Customer Support Center is contacted". I still wonder why the update has not been released as hot-fix download or maybe even part of the Windows Update?? It remains to test the same behavior on .NET 4 and see.

No comments:
Post a Comment