How To: Get up and running with the Silverlight 2.0 Blueprints for SharePoint 2007 

Author: Tobias Zimmergren

I got a chance to finally try the blueprints out, and it works fine. It's a couple of steps on the way that needs to be performes, listed below.

What you need to think about when setting it up is to make sure the following pre-requisities are installed on your SharePoint server:

  • .NET Framework 3.5 installed
  • Service Pack 1 for SharePoint (WSS 3.0 / MOSS 2007 depending on which version you run)
  • Silverlight 2.0 beta 1 runtime browser plugin
  • Configure the *.xap file type extension as a MIME type in your IIS webserver as: application/x-silverlight-2-b1
  • Configure the web.config using the ASP.NET 3.5 AJAX tags and the Silverlight configurations

Since I make an assumption that you guys already know how to complete the first few tasks here, I'll just give you the web.config changes that needs to be made and then you can simply run the Setup for the Blueprints and have a whole lot of Silverlight/SharePoint fun.

Changes that needs to be done in your SharePoint application's web.config in order to run Silverlight applications

This section will give you a walkthrough to what you need to do in your web.config in order to get the Silverlight Blueprints up and running.

Under the <configSections>-element, add the following code:

<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
  <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
      <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
      <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
      <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
    </sectionGroup>
  </sectionGroup>
</sectionGroup>

Under the <assemblies>-element, add the following code:

<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

Under the <pages>-element, add the following code:

<controls>
  <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>

Under the <httpHandlers>-element, add the following code:

<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

Under the <httpModules>-element, add the following code:

<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Under the <runtime>-element, add the following code inside the <assemblyBinding>-tag:

<dependentAssembly>
  <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
  <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
  <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>

Under the <configuration>-element, add the following code at the end (in the bottom of web.config)

<system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
        <remove name="ScriptModule" />
        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </modules>
      <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <remove name="ScriptHandlerFactory" />
        <remove name="ScriptHandlerFactoryAppServices" />
        <remove name="ScriptResource" />
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
             type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
             type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </handlers>
    </system.webServer>

Time to install and deploy the Silverlight Blueprints and try the Silverlight Web Part out!

If you've come this far and ensured that your SharePoint site still runs with the newly added lines of code, and you have ensured that all the aforementioned pre-requisites are fulfilled - You're ready to go!

  1. Run setup.exe for the Blueprints Hello Silverlight 2 Web Part and make sure that the System Check passes all tasks
    Silverlight Blueprints Setup
  2. Define which web applications that you would like to deploy this webpart to (tip: the one you've edited web.config for would be a good choise ;-)  ) - In my case it's http://zimmergren:8003 
    Define where the solution should be deployed
  3. Just hit next and let the installation and deployment complete - Sit back and relax for those sweet 8 seconds.
  4. Navigate to the site application where you installed the Blueprints (In my case http://zimmergren:8003 which is a normal Collaboration Portal), from there, click the following:
    1. Site Actions
    2. Site Settings
    3. Modify all site settings
    4. Site Collection Features
    5. Activate on the feature called "Silverlight BluePrint for SharePoint: Hello Silverlight 2 Web Part" 

      Activate the Silverlight BluePrint for SharePoint web part
  5. If you havn't already, create a new Blank Site (for ease and simplicity) and call it anything (I called mine Blueprints)
  6. Do the following:
    1. Site Actions
    2. Edit Page
    3. Click "Add a Web Part"
    4. Locate the section called "Silverlight BluePrint for SharePoint"
    5. Choose the Web Part called "Silverlight BluePrint for SharePoint: Hello Silverlight 2 Web Part"
      Add the Silverlight WebPart to your SharePoint page
  7. You're all set. Cross your fingers and hope that it all works :-)

Proof that it actually works

On this screenshot you can see that the Web Part works, and when I right click you see the Silverlight menu as in any other Silverlight application.

Hello Silverlight 2 Web Part Proof Of Concept

And here's another image with the Picture Viewer Silverlight WebPart:

Silverlight BluePrint for SharePoint Media Viewer Web Part Proof of Concept

Known Issues

  • If the version of your Silverlight 2.0 beta1 runtime differs from the one the Blueprints were compiled with, you'll end up with an empty white webpart - although you can rightclick and get the Silverlight menu to show. In order to fix this problem, simply open the source project in Visual Studio and recompile it - then copy the .xap file to your setup's ClientBin folder and replace the one there. (Or simply copy it to your filesystem directly to e.g. C:\Inetpub\wwwroot\wss\VirtualDirectories\8003\ClientBin\SL.HelloSilverlight2\SL.XAML.HelloSilverlight2.xap
    • This problem was solved after conversating with Patrick, so - I now owe you a beer when I see you Patrick!

Last words

I sincerely hope that this helps you out in the process of configuring and getting your Silverlight Blueprints for SharePoint up and running quickly and with ease!

Thanks for tuning in, please leave a comment or drop a line in the mail - appreciate it! :)

Posted by; Tobias Zimmergren on http://www.zimmergren.net

Technorati Tags: , ,
 
Posted on 19-Mar-08 by Tobias Zimmergren
22 Comments  |  Trackback Url  |  Link to this post | Bookmark this post with:        
Tags:
 

Links to this post (Trackbacks/Pingbacks)

Comments

Wednesday, 19 Mar 2008 09:06 by NICE
Nice one. i struggeled with the last point for 2 days with the different versions. did a re-compile as you said and it works. thanks, and thank patrik :)

Thursday, 20 Mar 2008 12:15 by Silverlighter
i like the way they have integrated silverlight with sharepoint inthe blueprints. its all really simple to use and when you said the recompile-thing at the end we could get our lab running all in all. thanks

Tuesday, 25 Mar 2008 09:36 by Dannis W
de e najs tobbe. keep it up så ska vi nog kunna göra lite fräna open-source projekt du och jag!

Thursday, 27 Mar 2008 11:01 by Jeremy
hi nice one. i never could get it to work but with this tutorial it works great. thansk alot! time for some coding time!

Saturday, 29 Mar 2008 08:53 by The Architect
hi. i got this running and it's awesome. have you implemented some further stuff with the blueprints - other than the stuff they released? would be cool to see something other than what they released aswell. im working on it right now =) keep you posted

Thursday, 3 Apr 2008 09:00 by Charles
Hi, Did you succed in installing the Colleague viewer webpart? For the others, recompiling the projects solved the troubles, but not for the colleague viewer. Maybe this is coming due to my config. I have a separate application pool to host "mysite". Thanks in advance if someone can help...

Thursday, 3 Apr 2008 03:45 by Tobias Zimmergren
Hi, thanks for the comments guys! The Architect: I havn't had the time to implement any further stuff, yet. Sorry. Charles: I havn't tried that one, sorry. What problems are you experiencing? Cheers / Tob

Wednesday, 23 Apr 2008 10:10 by Kinga
Hi, your post was really helpful when I was trying to install the blueprints. But now I would like to ask if the SP1 update is neccessary for the blueprints or for every Silverlight 2 in Sharepoint? Thanks in advance, Kinga

Monday, 28 Apr 2008 03:30 by Tobias Zimmergren
Hi Kinga, You do not need SP1 in order to run Silverlight applications - just follow the steps provided in my step-by-step guide and you're all set! :)

Wednesday, 14 May 2008 10:38 by

Saturday, 14 Jun 2008 10:56 by Adam
Awesome post! Works like a charm without any errors or problems at all! thanks thanks thanks!

Sunday, 13 Jul 2008 10:44 by bigmoe
Hi all, great stuff here.. I have the hello world 2 in silverlight up and running but the community colleague webpart in WSS appears for a few seconds and then goes away!! i dont know what im doing wrong this is done after i have recompiled the project i have silverlight beta for vs 2008.. anyone is having the same problem!! best regards, BiGmOe

Thursday, 17 Jul 2008 04:33 by Mohammed Idrees
Hi, Thanks for posting the complete checklist. However I could not able to get my silverlight web part displayed on the sharepoint site. It gives the exception of initialize error(2104). Unable to download the silverlight application. Please look into web server settings Again Thanks in anticipation

Thursday, 31 Jul 2008 07:47 by Turkey
Thanx You.. Perfect Docs

Tuesday, 9 Sep 2008 03:23 by devadkarramesh
Hi, thanks for posting such good article.Can you share the setup for silverlight 2.0 beta 2 so that i can try the same thing because i am trying to deploy the web part with silverlight 2 beta2

Tuesday, 30 Sep 2008 09:22 by AM21
hi, i followed the steps as mentioned above, but i'm getting this error message popped up after added my silverlight webpart. Err msg: could not load file/ assemble ' system.WEB.SILVERLIGHT. ver 2.0.5.0....' or one of its dependencies. the system could not find the file specification. has any1 before received this message or any idea whats the problem

Sunday, 26 Oct 2008 11:43 by kiteboardertje
am21 did you add the system.web.silverlight to the Gac? most possibly that is youre problem I myself are in problems with the webconfig trying to figure out what i am doing wrong

Sunday, 26 Oct 2008 02:59 by Tobias Zimmergren
Note: This article is for Silverlight 2.0 Beta 1. Things might've changed which might cause this post to be incorrect if using the 2.0 Final version. I'll post an updated version soon. Cheers

Wednesday, 29 Oct 2008 08:12 by kiteboardertje
hi Tobias i gave you the wrong url for my blog for the final version of silverlight it is here: http://home.kbworks.nl/Blog/archive/2008/10/28/Setup-SharePoint-environment-to-use-Silverlight-2.0.aspx

Name:
URL:
Email:
Comments:


MCTS WSS 3.0 (Developer and Administration/Configuration) MCTS MOSS 2007 (Developer and Administration/Configuration) MCP