Silverlight build fix.

Note that some of the formatting changed (I think I simply cleaned up a mix of tabs and spaces). Only a few lines were actually inserted (exluded two methods using ASCII encoding). Fixes #628.