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.

  • Kai Iniko

    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?

  • http://ox.no Håvard

    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...?

  • JINXz

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

  • JINXz

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

  • http://ox.no Håvard

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

  • Inge

    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…

  • Inge

    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.

  • Inge

    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…

  • Atul

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

  • http://ox.no Håvard

    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.

  • sachu

    It doesnt change any settings …works fine….

  • http://www.adeptinfotech.com Arwind Prasad

    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

  • http://ox.no Håvard

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

  • Gary

    Will this work with Casini or just IIS?

  • http://ox.no Håvard

    Gary: Silverlight applications run on the client side, and hence work with any web server capable of serving the files to the client side.

  • http://jeremiah.soundviews.us Jeremiah

    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

  • http://ox.no Håvard

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

  • http://www.coderewind.com Daniel

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

  • Marjoan De Guzman

    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!

  • ashok

    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

  • http://ox.no Håvard

    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.

  • http://footballed.blogspot.com sundeep

    I hope this works…

  • Wynter Choe

    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.

  • Mohamed

    When i try to install, it is giving an error 2869 (unexpected error installing this package). I am using windows 7 and have installed visual studio 2005.

  • http://ox.no Håvard

    @Mohamed: The template has issues with UAC on Vista and 7 which haven’t been adressed. If a lot of people post a desire for the template to work on Vista and 7, I’ll get it done.

  • Abhilash

    While installing, it gave an error 2869 (unexpected error installing this package). I am using windows vista and have installed visual studio 2005. Please help get the template work in vista i need it urgently.

  • http://ox.no Håvard

    Looked into the issue now, and it turns out the solution is simple – the MSI requires administrative privileges, and doesn’t elevate itself by default. As a workaround, run

    msiexec /i SilverlightProjectTemplate.msi
    

    from the command line as administrator.

  • http://silverlight siva

    hi I need to develop silverlight application in visual studio2005 how it ll be is it support for silverlight. If it support specify the version of that and explait how it will be

  • http://ox.no Håvard

    This is an old post and a lot has changed since Silverlight 1.0/1.1 and the creation of this project template. I strongly recommend you to use a more recent Visual Studio version if you are developing a real Silverlight application.