Adventures with Silverlight 3.0 and SharePoint – Part 1
I have been working on getting Silverlight 3.0 to work with SharePoint 2007 and I wanted to share with you the progress I have made and some of the challenges I have remaining.
Project
This project uses Silverlight 3.0, the Silverlight Toolkit for 3.0, and RIA Data Services. So it is basically using as much as it can that is new. This means we have a Entity Model and a ASP.NET web application that the Silverlight application will use. It also uses authentication using the new Domain Service for authentication.
What I did
So the first thing I did was to follow the steps in this blog post about Silverlight 2. I just changed it to be the System.Web.Silverlight from 3.0. The suggestion for upgrading the web.config for Silverlight worked great for bringing most of the stuff I needed.
I then did the following steps:
- Copied my project under the _layouts folder
- Copied the bin folder for my project to the VirtualDirectories\80\bin folder of SharePoint
- Ran gacutil on system.web.silverlight
- Ran gacutil on system.web.ria
- Ran gacutil on system.web.domainservices.webcontrols
I then made some changes to the web.config of my project, namely removing everything that was already in the web.config for SharePoint. The last change I did was to make the bin folder have FullTrust. I did this by adding the following to the wss_minimaltrust.config file:
1: <CodeGroup class="UnionCodeGroup" version="1"
2: PermissionSetName="FullTrust">
3: <IMembershipCondition
4: class="UrlMembershipCondition"
5: version="1" Url="$AppDirUrl$/bin/*"
6: />
7: </CodeGroup>
After making these changes, the next problem I ran into was around RIA. It makes calls using a DataService.axd. So that needed to be added to the web.config file. In <system.web>:
1: <httpHandlers>
2: ...
3: <add path="DataService.axd" verb="GET,POST" type="System.Web.Ria.DataServiceFactory, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
4: validate="false" />
5: </httpHandlers>
And <system.Webservers>:
1: <handlers>
2: ...
3: <add name="DataService" verb="GET,POST" path="DataService.axd"
4: type="System.Web.Ria.DataServiceFactory, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
5: </handlers>
That information is talked about in the Silverlight forum for getting it to work with Azure here.
I then tried to get my application to load the SharePoint master page but I ran into a problem where it tells me:
1: The referenced file '<path to master>' is not allowed on this page.
I am currently investigating that error and will post more as I progress. If anyone else is trying to get this to work with SharePoint or has any suggestions, I’d love to hear them.
Comments
Anonymous
June 02, 2009
PingBack from http://microsoft-sharepoint.simplynetdev.com/adventures-with-silverlight-30-and-sharepoint-%e2%80%93-part-1/Anonymous
June 02, 2009
I have been working on getting Silverlight 3.0 to work with SharePoint 2007 and I wanted to share withAnonymous
June 02, 2009
In this Issue: Sergey Zwezdin , Steve Berry , Colin Eberhardt , and Mike Taulty . Shoutout: Tom is postingAnonymous
June 03, 2009
Thank you for submitting this cool story - Trackback from DotNetShoutoutAnonymous
November 22, 2009
Did you succeed in making RIA working with moss ? We are currently facing the same problem and do not succeed thanksAnonymous
November 23, 2009
Manu44, I did. Take a look at the next post: http://blogs.msdn.com/tom/archive/2009/06/15/adventures-with-silverlight-3-0-and-sharepoint-part-2.aspx