Quick config for Silverlight in SharePoint 2007

Categories:  Uncategorized

As promised during the Sharepoint User Group presentation on Silverlight in SharePoint:

Configuring SharePoint for Silverlight Development Checklist(’ish)

PreReq’s:

  • Windows 2008 OS installed and running with appropriate roles/features
  • SQL Server installed and runningWSS 3.0(sp’d)
  • Visual Studio 2008(sp’d)
  • VseWSS (1.2 or later):
    http://www.microsoft.com/downloads/details.aspx?FamilyID=7bf65b28-06e2-4e87-9bad-086e32185e68&displaylang=en
  • Create your Web Application and a Test Site.
  • Test that your site works.

I’d recommend backing up your VHD at this point, just in case things go awry. And they will. Especially the night before your demo the technology. Not that I’m speaking from experience or anything.

Silverlight Preparation

  • Install Silverlight Tools and the Toolkit:
    http://www.silverlight.net/GetStarted/
  • Make sure that your IIS installation has the MIME type for the .xap extension:
    Extension: .xap
    MIME type: application/x-silverlight-app
  • GAC the Silverlight .dll *:
    The .dll is most likely located at:
    C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server
  • use Gacutil or filesystem to get the dll into Windows\assembly

    *don’t forget to do this as Administrator.

Configure the Web.Config file:

Backup your sites web.config file!

Here’s a trick that worked on my new vhd and if it doesn’t work for you, hit the web and

search for ‘configuring sharepoint for silverlight’ and you’ll find the hard .config entries for the complete file. In an attempt to do a quick ramp up of the process, try this:

Open Visual Studio 2008.

Create a new Web Site, targeting the 2.0 Framework:

Open the new sites web.config file and delete the contents.

Copy the entire contents from your SharePoint web.config file to the site’s file.

Save it.

Right click on the site project file and select PropertyPages.

Click on Build and change the targeted framework to 3.5:

Add the next few options to the sections as noted:

<system.web><compilation><assemblies> :

<add assembly=”System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />

<system.web><pages><controls>:

<add tagPrefix=”asp” namespace=”System.Web.UI.SilverlightControls” assembly=”System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />

Copy the config contents over to your SharePoint web.config file, replacing the

contents. Save the file.

Reset IIS.

Your Sharepoint environment should be ready to rock and roll the Silverlight development.

My next post will cover a short Silverlight web part built and deployed to SharePoint. Stay Tuned!

One Comment to “Quick config for Silverlight in SharePoint 2007”

  1. Links (6/4/2009) « Steve Pietrek – Everything SharePoint and Office

Leave a Comment