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!
- Run setup.exe for the Blueprints Hello Silverlight 2 Web Part and make sure that the System Check passes all tasks
- 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
- Just hit next and let the installation and deployment complete - Sit back and relax for those sweet 8 seconds.
- 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:
- Site Actions
- Site Settings
- Modify all site settings
- Site Collection Features
- Activate on the feature called "Silverlight BluePrint for SharePoint: Hello Silverlight 2 Web Part"
- If you havn't already, create a new Blank Site (for ease and simplicity) and call it anything (I called mine Blueprints)
- Do the following:
- Site Actions
- Edit Page
- Click "Add a Web Part"
- Locate the section called "Silverlight BluePrint for SharePoint"
- Choose the Web Part called "Silverlight BluePrint for SharePoint: Hello Silverlight 2 Web Part"
- 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.
And here's another image with the Picture Viewer Silverlight WebPart:
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