Silverlight Project Template for Visual Studio 2005

For those of you who do not want to grab the Visual Studio 2008 beta and/or wait for the release, I have created a Silverlight Project Template for Visual Studio 2005. This template makes it possible to develop Silverlight solutions under Visual Studio 2005. Grab the installer here if you can’t wait, or read on for further information.

In case you are not familiar with Silverlight, here’s the short version: Silverlight is Microsoft’s new cross-browser, cross-platform plugin for creating rich interactive applications. Silverlight implements a subset of the .NET runtime and Windows Presentation Foundation in particular. Cross-platform means Windows and Mac OS X, so there is no Linux support yet, but the Mono project are working on their own implementation of Silverlight, dubbed Moonlight.

What I find particularly interesting is that Silverlight implements a new runtime platform known as the DLR, which makes it possible to use (and blend) dynamic languages such as Python, Ruby, and Jscript when creating Silverlight applications. More generally, the DLR is a runtime for dynamic languages of any kind, which makes it one of the most interesting recent additions to the programming universe.

Longing to fiddle with Silverlight, I came across documentation on how to create Silverlight assemblies in Visual Studio 2005 written by Michael Schwarz, and created the project template based on that.

To ease the task of creating Silverlight projects, the template includes a wizard which asks for the path to your Silverlight installation, and remembers it for the future if it is correct. No further input is needed.

Note that debugging Silverlight assemblies is not possible under Visual Studio 2005, to my knowledge. If I am wrong, let me know, and I will try to add support for out-of-the-box debugging when launching the project from Visual Studio 2005. For now, you will have to point your browser to the Default.html file included in each project.

23 Comments so far »

  1. Kai Iniko said

    on September 22 2007 at 20:48

    When I attempt to run after installing I see nothing in the IDE and this in the event logs:

    “One or more Visual Studio templates do not match any installed project packages.”

    I am running VS 2005 with SP1 on Window Server 2003.

    Any ideas?

  2. Håvard said

    on September 25 2007 at 21:13

    Please check the following: 1. Does your registry contain a key named HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\UserProjectTemplatesLocation? 2. If it does, does the folder it points to contain a folder named Visual C#, and does that contain a file named SilverlightProject.zip? 3. If the registry does not contain the key, does your account’s “My Documents” folder have a subfolder at Visual Studio 2005\Templates\ProjectTemplates\Visual C#, and does that contain the zip file? 4. Does your GAC (%SYSTEMROOT%\assembly) contain the OX.VSE.Silverlight assembly? 5. Do you see Silverlight project under My templates when you click File -> New -> Project...?

  3. JINXz said

    on November 22 2007 at 23:05

    My anti-virus picked up a hidden file extension. Default.html.js????

  4. JINXz said

    on November 22 2007 at 23:33

    And my Av doesnt want to ignnore it! Anyway…workaround! ;) But thanx, its nifty!

  5. Håvard said

    on November 25 2007 at 15:13

    Nice to hear that it’s working out for you. :)

  6. Inge said

    on December 6 2007 at 16:08

    Thanks for creating this template. It’s much better than having to do it all manually.

    Can you please tell me if there are any additional steps I should follow AFTER I have been able to build the solution?

    I am certain that I have the Silverlight 1.1 Alpha plugin installed, since I can view samples online. However, I followed Microsoft’s tutorial for building a v1.1 Silverlight Clock, and it is not displaying on the page.

    The only thing I see, is a “Get Microsoft Silverlight” (Alpha) download banner. The Silverlight Clock control is not created on the page (I verified this using the document.getElementById(‘SilverlightControl’) statement.

    It might be something pretty simple, but I can’t figure out what’s wrong…

  7. Inge said

    on December 6 2007 at 16:23

    Update: I managed to get the html to display properly after adding mime types for xaml and dll to the website.

    The only problem remaining now, is that it looks like the code in the class file is not executed…

    If you have an idea how I might be able to fix that, please post the answer here. Thanks in advance.

  8. Inge said

    on December 6 2007 at 16:30

    Okay, does someone have a baseball bat that I can hit myself over the head with?

    Last problem solved: I had been so focused on solving all the “hard” problems, that I simply forgot to include the Loaded=”[Eventname]” in my Canvas in the xaml file…

  9. Atul said

    on December 17 2007 at 06:56

    does this template affect to other settings of VS 2005??

  10. Håvard said

    on December 17 2007 at 14:53

    The template does not affect any settings of VS 2005. It merely puts itself in your template directory, and uses a registry key to remember the Silverlight installation path.

  11. sachu said

    on January 4 2008 at 12:12

    It doesnt change any settings …works fine….

  12. Arwind Prasad said

    on January 4 2008 at 18:36

    I am trying to add silverlight project but its asking for installation path and when i give the installation path its showing an error that ‘path missing required file mscorlib.dll’.

    Thanks

  13. Håvard said

    on January 5 2008 at 17:11

    Arwind: You are not providing a valid installation path. Silverlight must have mscorlib.dll and a few other assemblies to function properly.

  14. Gary said

    on January 14 2008 at 23:42

    Will this work with Casini or just IIS?

  15. Håvard said

    on January 15 2008 at 00:03

    Gary: Silverlight applications run on the client side, and hence work with any web server.

  16. Jeremiah said

    on January 31 2008 at 18:51

    Any help on what is a “valid installation path”? I can’t find a Silverlight directory with the mscorlib.dll (among others). When installing Silverlight, I don’t get any notification of what directory the .dll’s are installed in. All references to the mscorlib.dll on my machine point to either the .NET Framework or an SDK…

    What is the standard install directory? And is version 1.1 required (even if I have the Silverlight 1.0 SDK?

    Thank you,

    Jeremiah

  17. Håvard said

    on January 31 2008 at 20:27

    Jeremiah: The default installation path is %PROGRAMFILES%\Microsoft Silverlight. The template should work with all versions of Silverlight.

  18. Daniel said

    on February 7 2008 at 17:42

    I cannot install this on my vista machine. Gives me an error code: 2869.

  19. Marjoan De Guzman said

    on March 17 2008 at 05:03

    Hi,

    I installed the template then tried to create a Silevrlight Project, but when asked to point to the Microsoft Silverlight installation path, an error occurred which says “Silverlight installation path is missing required file agclr.dll. Please provide another path.”

    I don’t know what to do, because I have installed Silverlight 1.0 and Silverlight 1.1 already in my PC.

    Can you help me with this, please email me your suggested solution at marjiepie@gmail.com

    Thanks!

  20. ashok said

    on March 22 2008 at 17:12

    I have downloaded the template and installed it. When i try to create a new silverlight application, it is asking for path which i provided, After that it is asking for mscorlib, algr System.Core.Xml dll’s, I am not able tofind them on the inter could you help me find them.

    Advanced thanks Ashok

  21. Håvard said

    on March 22 2008 at 23:08

    Marjoan/ashok: You need to have Silverlight installed on your machine. The default installation path is (as mentioned in a previous comment) %PROGRAMFILES%\Microsoft Silverlight. The required DLLs all reside in that directory.

  22. sundeep said

    on March 27 2008 at 17:59

    I hope this works…

  23. Wynter Choe said

    on August 18 2008 at 10:36

    Hi I’m interesting your template. I think this is very good for you. But On Vista system, I can’t install your template. This may be caused from UAC. I need your kindly help. Please help me.

Comment RSS · TrackBack URI

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment:

Get Adobe Flash playerPlugin by wpburn.com wordpress themes