I learnt about WPF icons and XP

I had a very nasty error to track down where a WPF application wasn't starting and throwing an exception. It worked fine on Windows 7 but when a user tried to run it on an XP machine it fell over with the following error:

"The image decoder cannot decode the image. The image might be corrupted."

This was being thrown right at start-up as the main window was about to be rendered. After a few dead ends the following page indicated the solution:

http://stackoverflow.com/questions/9828181/xamlparseexception-on-setting-icon-from-xaml-on-winxp-winserver2003

Basically XP doesn't handle icons with large colour depths. Reducing the colour (or color for you Americans out there) depth to 8 bits solved the problem.

Thank you NestorArturo.