[Note, 21-May-2010. Silverlight 4 has been released. For a step-by-step guide to installing Silverlight 4 with Visual Studio 2010, see my post Creating a Silverlight 4 Development Machine].
A beta version of Silverlight 3 was released at MIX09 in March. Since a beta version of Visual Studio 2010 was also just released–in May–it makes sense to set up a Silverlight 3 and Visual Studio 2010 development environment. My last post included screenshots of the installation process for Visual Studio 2010. This post will cover installing the remaining bits needed for a Silverlight 3 development environment.
Note: Also take a look at the official Getting Started page for Silverlight 3.
This post will describe installing Silverlight 3 bits on top of a clean Windows 7 / Visual Studio 2010 environment. I won’t install the Silverlight 2 components, so the resulting environment will be targeted exclusively at Silverlight 3.
At the moment, the Silverlight 3 beta is targeted at Visual Studio 2008 SP1, rather than Visual Studio 2010. (See Tim Heuer’s blog post explaining this). What this means is that we can’t just run the Silverlight 3 Tools installer. If you try, you’ll get the following error.
Installing the Silverlight 3 Beta SDK
Instead, you’ll need to just install the Silverlight 3 Beta SDK manually. Once you download the SDK installer and launch it, you’ll get the following screen:
Then you get a license dialog. Note the comment about this beta license expiring 30 days after the commercial release of Silverlight 3, but no later than 30 Sep, 2009. Does this imply that we’ll see a final release of Silverlight 3 by 30 Aug, 2009?
If you do a custom install, you’ll see the following features and components listed:
Here’s a quick summary of what is being installed:
- Silverlight Tools – Components needed for building Silverlight applications
- The core Silverlight DLLs, e.g. agcore.dll, coreclr.dll, et al
- Build Components – Components used to build Silverlight projects
- Microsoft.Silverlight.Build.Tasks.dll, et al
- Client Libraries – Silverlight Client Libraries and Controls
- System.Xml.Serialization.dll, System.Xml.Linq.dll, System.Windows.Controls.Navigation, et al
- Server Libraries – Silverlight Server Libraries and Controls
- System.Web.Silverlight.dll, et al
Now we’re ready to install:
The install completes, and a dialog reminds us that the actual Silverlight 3 Beta runtime is not yet present. (Actually, there is an error in this dialog — it’s reminding us that the Silverlight 2 runtime is not present).
Installing the Silverlight 3 Developer Runtime
Now we need to install the actual Silverlight 3 runtime, which you can download from here.
We start with the familiar Silverlight install splash screen (now branded as Silverlight 3 for Developers).
Off we go..
The runtime install completes quickly.
Pretty simple. You now have all of the important stuff that you need for developing Silverlight 3 applications with Visual Studio.
Building a Silverlight Application with Visual Studio 2010
When you bring up the New Project wizard in Visual Studio, you’ll see two types of Silverlight projects listed:
- Silverlight Application
- Silverlight Class Library
If you create a new Silverlight Application, you’ll see the Add Silverlight Application dialog. But notice that there is now a dropdown labeled Silverlight Version. This defaults to Silverlight 2.0, but you can select Silverlight v3.0 to create a Silverlight 3 application.
You’ll see a similar dialog if you try to create a Silverlight Class Library.
The Silverlight Navigation Application
But notice that there is one Visual Studio template that shows up if you install Silverlight 3 Beta in Visual Studio 2008 SP1 that does not show up in Visual Studio 2010 — the Silverlight Navigation Application. This is installed as part of the Silverlight 3 Tools installer, which we were unable to run.
We need to pull this particular template from Visual Studio 2008 SP1 into Visual Studio 2010. To do this, install the Silverlight 3 Tools installer on a machine that is running Visual Studio 2008 SP1. Then fire up Visual Studio 2008, create a Silverlight Navigation Application project, and select Export Template from the File menu.
You’ll see a dialog asking you to select the project to export a template for. We’ll select the main navigation application.
You can also give the new template a description and select an icon.
When you’re done, a new Windows Explorer window will pop up, containing a .zip file for your new template. Now copy this .zip file to the following directory on your Visual Studio 2010 machine:
C:\Users\myname\Documents\Visual Studio 10\Templates\ProjectTemplates\Visual C#
Now when you bring up the New Project wizard in Visual Studio 2010, you’ll see a new template that you can use to create a Silverlight Navigation Application.
That should do it — you now have a fully functional Silverlight 3 / Visual Studio 2010 environment.
Technorati tags: Silverlight, Silverlight 3, Visual Studio 2010