This tip is somewhat buried at the end of my RC0 introductory post. However, I can’t emphasis enough that the main reason you get initialization errors or the WSOD (White Screen of Death) in Silverlight 2 is problems in your visual states.
There are a few approaches and steps to debugging this.
- Open your project in Blend and look at the xaml files (start with app.xaml if that’s where most of your styles are located). Let Blend parse it and report errors. Fix what it finds and then run your app. Blend will catch many things Visual Studio will not.
- If that doesn’t remove the error, comment out the guts of your styles (not the outermost style tags) one by one, running each time. Yes, this is like how we used to have to debug undebuggable stuff like early ASP, but it is a tried and true approach. If you run after each time, you’ll be able to see which one was making your app bomb. Fix or recreate the offending style or get more granular with your commenting-out.
- If that doesn’t work, save a copy of your project and then remove all the “vsm:” prefixes from your styles. This isn’t step #1 because there may be cases where the “vsm:” prefix is required, and it will be next to impossible for you to find them after the fact. Just remember to back up the files before you do this. This problem usually manifests itself at design time
These are all artifacts of developing on beta software and then porting to a release. As an early adopter, this is not unexpected. Microsoft has given everyone a big old heads up by releasing the developer-only RC0, so I encourage you to use this time to get your apps ready for RTW.
If you run across any issues, please ping me here, or if you want a quicker response, post the questions on the forums over at silverlight.net
[Update: As I mention in the comments below, keep the vsm: in all the Visual* tags, and remove it from the other ones which are not vsm-specific. This makes perfect sense as the vsm: namespace prefix only needs to scope the items that are vsm-specific]