Refactoring Root namespace Breaks Silverlight Applications (and How to Fix It)

One scenario that happens fairly often for new apps is to create a new project and then part way through decide you want to rename it, or at least the default namespace.  With Silverlight apps, when you do this and try to run your project, you’ll see an error:

 Line: 56
Error: Unhandled Error in Silverlight Application 
Code: 2103    
Category: InitializeError       
Message: Invalid or malformed application: Check manifest     

This happens because the EntryPointType in the AppManifest.xaml file is not updated when the refactoring occurs.  This value is generated at build time from the Startup Object in the project properties.  You can fix this issue by updating the Startup Object for your project: