Wednesday, May 28, 2008

Getting started with SharePoint and Silverlight - Part II

In the first part I talked about how to get your first Silverlight app up and running. Now let's see how to get this into SharePoint. Patrick has created an excellent checklist about How to configure your SharePoint extended IIS Web app for working with Silverlight 2 applications. 

For step 4 - if you need to add System.Web.Silverlight.dll to the GAC - you will find this file underneath C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server (default installation folder for the Silverlight SDK).

For step 6 - I used  the 3.5 Config feature from Codeplex -  which works pretty good.

To test everything out - let's start of with one of the samples in the  Silverlight BluePrint for SharePoint - which contains six sample applications:

  • A simple “hello, world” sample showing Silverlight in a Web part.
  • A Silverlight slider control as a SharePoint custom field type.
  • A navigation control.
  • A Colleague Viewer
  • A Silverlight picture viewer for a SharePoint picture library.
  • A visual how-to center, created in Silverlight and based on a SharePoint list, for viewing videos.

Let's start off with the Silverlight "Hello world" example. Steps that I took:

  1. Extracted the setup project and ran the installation - after this I could see the HelloSilverlight appear but it would not load the Silverlight app
  2. Next I recompiled the Silverlight app using Visual Studio 2008 and copied the XAP file in the clientbin directory over the existing XAP file.

Another interesting webpart which is packaged together with the "Hello world" sample is the SilverlightPart which is basically a webpart which can host a Silverlight application (1.0 or 2.0). You can select the Silverlight app to host by selecting it using the webpart properties.

When I started fiddling around with these Silverlight apps - I regularly noticed this error message "Internet explorer has encountered a problem with an add-on and needs to close. The following add-on was running when this problem occurred
npctrl.dll" - luckily I found this post - IE crashing with Silverlight 2 - Part II - It was not fixed ! But it's now! and this did the trick - apparently Silverlight tried to go online to get an update but my VPC had no networkconnection.

That's it for today, in a next posting I will try to explain what the code in the HelloSilverlight webpart does.

No comments: