Wednesday, April 9, 2008

Silverlight Weirdness (the sequel to Silverlight Woes)

First off, let me thank Scott Guthrie for taking the time to respond to my mails and pointing me to Peter Puszkiewicz, and let me thank him for helping me debug this situation...

Peter requested that I try the following steps:

<quote>

1. I'll call this one out, but it's a lot of work, so maybe don't try this first. you seem to have a lot of stuff installed (including two versions of Blend)... why don't you clean your vm and start by just following Bradley's post. Get the base package running, then add to it to find the culprit

2. go to Silverlight.net and view a Silverlight sample. Does the control launch for you at all? does it launch for a beta 1 sample? Best way to be sure is to right-click on screen space that you expect to be Siverlight and check to see if a menu with the sigle item "Silverlight Configuration" shows up

3. Can you send me the full registry hive for the Silverlight ClSID? I remember that some tools expected to find progID AgControl.AgControl to find a path to npctrl.dll... this may still be the case

4. Along those lines, can you run Process Monitor, attach (filter) it to your instance of devenv.exe, and send me a dump of what is happening while you are trying to start up the Silverlight project? I'd like to see what it's looking for an not finding. If you're not familiar, Process Monitor is a great tool from Microsoft/SysInternals which allows you to monitor HDD/Registry requests from processes. It is also free:)

5. Make sure you have access to (read access) to all Silverlight dll's/registry keys. You can find the relevant keys by looking for posts from DHarvey on the Silverlight.net forums. Alternatively, I can send them tomorrow.

6. Try running VS as an admin

</quote>

  1. Now, I had started with a clean VM with nothing but Visual Studio to start with, and I'd never been able to get the base package working. The installation of Blend was more an act of desperation hoping the installation would iron out any wrinkles in the VS 2K8 install, so I wasn't going to try this instanter...
  2. I remember having been to Silverlight.net and trying time-after-time to install Silverlight, which would report a successful installation but request me to install again. I thought I fixed that somehow!
  3. I did this - walking all over the registry and looking for anything weird. Never found anything out of the ordinary here...
  4. This was a good thing to try. But before I started doing this, I decided to verify Step 2 again.
  5. This was a given since I was running the VM as an Administrator.
  6. Ditto...

Now I've followed some pretty interesting steps to set up my Virtual Machine farm, so I decided to start at the root installation - a VM with nothing on it but a light version of Windows XP SP2, properly patched and updated. So no Visual Studio, no Microsoft Office, nothing!

I fired up IE and sauntered on to http://silverlight.net/showcase.

Right there, I realized that I had NEVER been able to install Silverlight properly. I then spent the next 2 hours installing and re-installing Silverlight, and turning on several services I had earlier turned off to tweak the VM installation to have a smaller footprint - each time being told the install was successful, but only to be invited to reinstall when I went to check out the showcase. The installation log and Event Viewer both showed me that the installations were "successful"!

Liar Liar!

It lies like a Persian Rug!

Then I got the idea of running procmon while IE loaded http://silverlight.net/showcase and trying to figure out what went wrong. After combing through about 25,000 lines of diagnostics looking for weirdness, I found that IE reported that it had successfully loaded the Silverlight DLLs!

Why do you need DSOUND?

The only innocent-looking failure was that it couldn't load DSOUND.dll - fair enough, you don't need DirectSound to browse the web, do you?

Now since I was running a development environment in a virtual machine, I reasonably assumed I wasn't going to need Wireless Networking, UPnP, Sound, System Restore, Help and Support, Windows Media Player among other modules which only contribute bloat to a development environment. I had therefore stripped them out using nLite before installing my development tools.

Anyway - just to cover all bases, I fished out a dsound.dll from another Windows XP installation and plonked it into the VM - and whadyaknow - it worked!! I was able to view all the Silverlight demonstrations I could find.

It Works!

I must confess I'm a little peeved by the strange dependency that Silverlight has on sound, of all things! This is supposed to be a development and web-application platform - and while it's arguable that sound and video make the user experience rich and cool, I don't think that it's defensible to make sound a mandatory prerequisite of the platform - and it's completely inexpiable that the platform would die without giving a clue of this strange dependency!

In sum - I'm finally able to get started on Silverlight.

Hello World!

At least I know His Gu-ness will respond to a mail in a timely manner if I'm similarly stumped the next time! And I can always use procman before mailing him next time!

Words of Wisdom!

No comments: