Upgrading Silverlight

I’ve hit some snags while upgrading my applications. Shawn Wildermuth has also. See his notes here.

Symptom: You use Silverlight.js to custom detect if Silverlight is installed and it reports that Silverlight is not installed when, in fact, it is.

Solution: Update to the Silverlight.js in the SDK-> Tools directory (Thanks, Shawn).

Symptom: You see a build error like: “The name ‘InitializeComponent’ does not exist in the current context” . This happens with other methods/XAML generated members.

Solution: The xaml generated .cs file is not being created. This happens because the build action is set on the XAML file to “SilverlightPage” instead of “Page”. Apparently, this is the new build action name. I got this because I brought some non-upgraded user controls into an already upgraded project. Normally, the Visual Studio upgrade wizard will take care of this.

Symptom: You get the message “Unable to start debugging. The Silverlight managed debugging package isn’t installed.” when trying to debug.

Solution: Run “silverlight_chainer.exe /extract” to get at the files inside. Then run “Silverlight.2.0_Developer.exe” I did this right over the top of the other Silverlight installs, and it seemed to work. See here for how to completely uninstall and re-install components.

Symptom: Silverlight debugging works in the Silverlight project, but it doesn’t in the ASP.Net project. Also, new versions of the Silverlight application aren’t getting copied over to the ASP.Net project.

Solution: The issue is that the Silverlight linkage mechanism has changed in Beta2. On the surface the project upgrade updates the linkage, but in my case, the .xap file was not being copied over. Worse, an existing .xap file was being used, and this was masking the problem. Go to properties for the ASP.Net project, select the “Silverlight Applications” tab, remove the existing linkage and add it again (make sure that Silverlight debugging is enabled and that a new test page isn’t created).