Partilhar via


Add Silverlight Web Parts to SharePoint Using New Visual Studio Extension

Last week at DevConnections in Orlando we announced the availability of the Silverlight SharePoint Web Parts Visual Studio Extension project that makes it easy for you to create Silverlight Web Parts for SharePoint 2010. This has been a project that I have been working on for a while and I am pleased how the first release turned out. The extension enables you to create a Silverlight Web Part project that uses the built in Silverlight Web Part that ships with SharePoint. This is a super quick and easy way to package you Silverlight application into a SharePoint wsp solution package that can be deployed to a sandboxed solution. But the extension also enables to you create a custom Silverlight Web Part based on a sandboxed Visual Web Part that ships with the Visual Studio 2010 SharePoint Power Tools.

image

Download: Silverlight SharePoint Web Parts

Watch the video on Silverlight TV to see how the extension works.

Silverlight TV 68: Worlds are Colliding! New Silverlight Web Parts for SharePoint

image

Install

Download the extension from the link above. The extension is packages as a .vsix file. Double click on the .vsix extension to install into Visual Studio.

(Note: Be sure to install the Visual Studio 2010 SharePoint Power Tools first)

Create

You will need to create 2 projects, a SharePoint 2010 project and a Silverlight project.

  1. Create a new Visual Studio Solution and add an Empty SharePoint project
  2. Add a Silverlight project to the solution
  3. Add a Silverlight Web Part project item to the SharePoint project

Adding the Silverlight Web Part does a number of things for you.

  1. Adds a module to deploy the Silverlight .xap file.
  2. Adds a Silverlight Web Part with all the properties set to point to the .xap.
  3. Adds a test harness wiki page in the SitePages library so that you can F5 and run the app.

image

Run

Press F5 to run the project. Since a test harness page was created when you added the Silverlight Web Part you can just browse to the Site Pages library

Special Thanks

I would like to give a special thanks to Scott Hillier who helped me develop this extension.

https://www.shillier.com/archive/2011/04/04/silverlight-sharepoint-2010-web-parts-visual-studio-2010-extension.aspx

Comments

  • Anonymous
    April 04, 2011
    Hi Paul, our group has been deploying Silverlight apps to our SP2010 site for a while now, and we've never encountered a reason to mess with the sandbox so far. Could you please outline the scenario(s) or usage(s) in which your Sandbox-deployment would help us do something with Silverlight solutions that can't be done outside of the Sandbox? Thanks!

  • Anonymous
    April 19, 2011
    Hi Paul, I have  been created silver light webpart project adn deployed  successfully and working  well for sample  control  only . When i am trying to add dll reference of System.Windows.Shapes AND  Microsoft.SharePoint.Client geeting error  on adding so i am not able to work with ClientObject model   for example ClientContext clientContext = ClientContext.Current; Can you please suggest me . Thanks Sharda

  • Anonymous
    April 19, 2011
    Hi Paul , My issue is resolved by adding dll  from C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATELAYOUTSClientBin. Thanks a lot for such nice post . Thanks Sharda

  • Anonymous
    December 20, 2011
    Using this new tool (which is totally awesome!) how could I deploy 2 new Silverlight Web Parts to be installed on the same page so that I could pass data between them?