Silverlight and Visual Studio

You may be puzzled sometime by a dialog box that Visual Studio displays about Silverlight. The dialog box comes in a number of forms, but basically it tells you that you need an updated version of Silverlight on your system. The dialog box also provides an URL where you can go to download the latest version. Because you can’t open your Silverlight project until you get the latest version of Silverlight (despite the fact that you opened it just yesterday without any trouble), you dutifully click the link and download the latest version of Silverlight. The file is likely named Silverlight_Developer.exe or something similar.

After the download is complete, you double click the file and begin the installation. However, the installation program tells you that you do indeed have the most recent version of Silverlight installed on your machine. Closing your project and reopening it produces the same error message. Of course, this is just the sort of frustrating problem that drives everyone (including developers) crazy.

The problem is that you do indeed have the latest version of Silverlight installed, but it’s the standard version, not the developer version. At some point, you likely performed an update of your Silverlight installation through your browser. The browser will always download the standard version because that’s all it needs. Visual Studio, on the other hand, requires the developer version.

Unfortunately, short of inspecting the files closely, nothing tells you about these two versions. When you look at the entry in the Programs and Features window, all you see is Microsoft Silverlight. There is nothing to tell you which version you have installed.

To fix this problem, uninstall the standard version of Microsoft Silverlight. Don’t uninstall the Microsoft Silverlight SDK entries. Now, double click the Silverlight_Developer.exe file again and the installation will run just fine. Close and reopen your project and you’ll find that it too works just as it should. If you have a browser open, make sure you close and reopen the browser as well or you’ll experience problems debugging your application.

It would be nice if Microsoft had provided a better entry in the Programs and Features window. Better yet, it could have provided a better error message when you opened your project. Lacking these helps means that you must discover just how to fix the problem on your own. Let me know if you encounter any other odd Visual Studio behaviors of this sort at John@JohnMuellerBooks.com.