MULTIMEDIA

Setting Up a Silverlight Development System

7/25/2010 5:10:59 PM
I_section2_d1e730.html

Getting Started with Silverlight 2

Some people say Microsoft's Silverlight technology is a "Flash killer," but I'm not sure that I agree. The similarities are striking. Both Adobe Flash (formerly Macromedia Flash) and Silverlight are browser plug-ins. Both support vector graphics, audio and video playback, animations, and scripting support. But their underlying technologies are different; Flash uses a semi-open binary format, and Silverlight is based on WPF. Before it was called Silverlight, the technology was code-named WPF/E (Windows Presentation Foundation Everywhere). And thanks to good browser support, Silverlight does really run everywhere, at least in theory.

At the time of this writing, Silverlight plug-ins are available for the two big players, Microsoft Internet Explorer and Mozilla Firefox on Windows. Also, a Mac OS X plug-in exists that targets Safari and Mozilla Firefox on the Apple platform. According to Microsoft, other platforms were considered, but given the high market shares of Windows and Mac OS X, these browsers were given priority.

Silverlight 2 requires Windows 2004 SP4 or higher (i.e., Windows XP, Vista, Server 2008) to run. Opera support is planned for a future release; Opera is currently the third most used browser and has a relatively small but very loyal user base.

NOTE

The Mono project (http://www.mono-project.com/), renowned for its open source implementation of .NET, is working on an open source Silverlight port that targets the Linux platform (and the Firefox browser there). This project is called Moonlight (see http://www.mono-project.com/Moonlight for a sneak peek). http://www.mono-project.com/MoonlightShots also shows some up-to-date screenshots of those efforts (see Figure 1). Microsoft has also announced that it is teaming with Novell to support the Moonlight project and bring Silverlight to Linux.

Figure 1. Some Moonlight screenshots


But what exactly is Silverlight, apart from a browser plug-in provider? The heart of the plug-in is the graphics subsystem, which supports a certain subset of WPF . It also includes the codes responsible for displaying audio and video content .

1. Setting Up a Silverlight Development System

For the programming part of Silverlight, a text editor would suffice, actually, but it is by far more productive for you to use a "real" development environment. The most obvious choice is to use some of Microsoft's offerings. From a code perspective, Visual Studio 2008 is currently the best choice for developing Silverlight 2 content. The full versions (Standard Edition, Professional Edition, and Team Suite) and the free Visual Web Developer Express Edition work. If you can use a paid version, you will get project template support, so that's preferable. We will use Visual Studio 2008 Standard Edition throughout this book. Whenever there are differences to the free Express Edition, this will be especially noted so that those users don't miss out on any important information.

There are no special prerequisites for installing Visual Studio or Visual Web Developer apart from using Windows XP or higher. You do not even need a web server, as the IDE comes with one! However, if you can, you may want to install Microsoft's IIS (Internet Information Services). IIS is hidden in the control panel, under Software (Vista: Programs), where you can turn Windows features on and off (see Figure 2).

When installing Visual Studio 2008, make sure you select the Visual Web Developer option (see Figure 3). Otherwise, the web editor will not be part of your IDE, which you need to create web sites since Silverlight is a web technology, whereas WPF is a desktop technology. If you want to use Visual Studio 2008 Express Edition, you can download a web-based installer at http://msdn.microsoft.com/vstudio/express/vwd/download/.

Figure 2. Installing IIS


Figure 3. Make sure you install Visual Web Developer as part of Visual Studio 2008


Whatever version of Visual Studio you install, you should apply any available service packs right away. (As of this writing, no service pack has been released, but you never know.) For Visual Studio 2005, Windows Vista users had to install a special Vista update patch as well. This is not necessary any longer for Visual Studio 2008, but it gives you a good idea why it is important to check for patches often.

The most convenient way to get your system up-to-date regarding software patches for Microsoft products is to use the built-in Windows Update mechanism. Microsoft Update is an extended version of that service. Windows Update gives you patches only for Windows and core Windows components such as Internet Explorer, but Microsoft Update also patches other Microsoft products, including Office, Visual Studio, and SQL Server (see Figure 4).

Activating Microsoft Update depends on which Windows edition you are using. For versions prior to Windows Vista, just go to the update web site, which will install the feature (http://update.microsoft.com/microsoftupdate/). If you are using Windows Vista, launch Windows Update from the Start menu and then choose the "Get updates for more products" link (see Figure 5). The next time you search for updates, you will also get patches for Visual Studio (and other installed Microsoft software).

Figure 4. Switch to Microsoft Update to get more than just Windows updates


Figure 5. Microsoft Update offers you more updates, including those for Visual Studio (here: Version 2005)


Once the IDE is up and running, it is time to make it Silverlight-aware. For both Silverlight 1.0 and 2, Microsoft provides SDKs. We are using the version 2 SDK in this book (see Figure 6). The final version of the Silverlight SDK is available in the Microsoft Silverlight download section at http://msdn2.microsoft.com/en-us/silverlight/bb187452.aspx. It installs documentation, Silverlight libraries including controls, additional ASP.NET server controls for Silverlight, and tools to enable CLR debugging. The SDK also offers to install a Visual Studio 2008 template. Afterward, you can install the Visual Studio 2008 Tools for Silverlight from http://www.microsoft.com/downloads/details.aspx?FamilyID=25144c27-6514-4ad4-8bcb-e2e051416e03&DisplayLang=en. This includes additional tools for Visual Studio's Silverlight support (see Figure 7). Visual Studio then gets several new templates, including a C# web site project template section for Silverlight (see Figure 8). Starting with a template such as this really facilitates all subsequent steps, since a web site based on these templates comes with a lot of helper code so that you don't have to type it all. At the time of this writing, Microsoft was preparing an all-in-one installer that installs the SDK, the Visual Studio add-in, and a browser plug-in (see Figure 9).

You need Visual Studio 2008 to install the templates; Visual Web Developer cannot use them.


Figure 6. The Visual Studio Tools for Silverlight installer


Figure 7. The Silverlight SDK installer


Figure 8. The new Silverlight templates in Visual Studio


Figure 9. The Silverlight Tools installer


Now you are ready to create Silverlight content, at least in a code editor.

Other  
 
Top 10
SharePoint 2010 : The Search User Interface - The Search Center
SharePoint 2010 : The Search User Interface - The Query Box
SQL Server 2008 R2 : Database Maintenance - Executing a Maintenance Plan
SQL Server 2008 R2 : Database Maintenance - Managing Maintenance Plans Without the Wizard
Game Programming with DirectX : 3D Models - OBJ Models (part 3) - Preparing OBJ Files for Direct3D
Game Programming with DirectX : 3D Models - OBJ Models (part 2) - Loading OBJ Files
Game Programming with DirectX : 3D Models - OBJ Models (part 1) - Understanding the OBJ Model Format
Game Programming with DirectX : 3D Models - Token Stream
Game Programming with DirectX : 3D Models - Files in C++
A Look At Truecrypt The Open Source Security Tool
Most View
Group Test: AMD FX-8350, FX-8320, FX-6300 And FX-4300 - All Vishera Processors (Part 1)
iPhone 3D Programming : Blending and Augmented Reality - Blending Extensions and Their Uses
SQL Server 2008 : Multiple Sources with SQL Server Integration Services
Filtering Out Evil with Firewalls (part 2)
The Download Directory (Part 1) - WinDirStat 1.1.2
Configure Server Core Postinstallation
Windows Server 2008 : The Migration Planning Phase - Documenting the Process for Migration
Samsung MV900F
iPhone 3D Programming : Adding Textures to ModelViewer (part 4) - Enabling Textures with ES2::RenderingEngine
Lenovo ThinkPad Edge S430 - Classic Business Laptop
C# 4.0 : Add a Static Constructor and Initialization
Adobe Photoshop CS5 : Working with Automate Commands - Working with Batch File Processing
Loewe AirSpeaker - High-end AirPlay speaker system
Some Of The Biggest Brands In The World Had Their Products (Part 9)
Preparing to Install Windows 7 (part 1) - Different Versions of Windows 7 & Hardware Requirements
Sony D-5: The First Mobile CD Player
Using Remote Assistance to Resolve Problems in Vista
Laptop For All Budgets (Part 1)
Remove Internet Limits With A VPN (Part 4)
Using Shapes in XAML