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.
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?
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 namedVisual C#, and does that contain a file namedSilverlightProject.zip? 3. If the registry does not contain the key, does your account’s “My Documents” folder have a subfolder atVisual 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 seeSilverlight projectunderMy templateswhen you clickFile -> New -> Project...?My anti-virus picked up a hidden file extension. Default.html.js????
And my Av doesnt want to ignnore it! Anyway…workaround!
But thanx, its nifty!
Nice to hear that it’s working out for you.
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…
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.
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…
does this template affect to other settings of VS 2005??
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.
It doesnt change any settings …works fine….
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
Arwind: You are not providing a valid installation path. Silverlight must have mscorlib.dll and a few other assemblies to function properly.
Will this work with Casini or just IIS?
Gary: Silverlight applications run on the client side, and hence work with any web server.
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
Jeremiah: The default installation path is
%PROGRAMFILES%\Microsoft Silverlight. The template should work with all versions of Silverlight.I cannot install this on my vista machine. Gives me an error code: 2869.
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!
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
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.I hope this works…
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.
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.
@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.