Click here to Skip to main content
11,927,167 members (52,477 online)
Click here to Skip to main content
Add your own
alternative version


14 bookmarked

Silverlight Web Part sandboxed Deployment in SharePoint 2010 using VS2010

, 18 Feb 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
How to deploy Silverlight Web Part in SharePoint 2010 using VS2010


Silverlight can be used to integrate rich, powerful applications into SharePoint at the Web part level of integration. It can live just about anywhere in the user interface With SharePoint 2010. My example will be geared toward how simple it is to publish a Silverlight application to a SharePoint site and use it in a web part.


It was my client requirement to deliver our Silverlight Application in SharePoint Site and continuous development and deployment.

Getting start with a Silverlight application using VS2010

Step 1: Open Visual Studio 2010 and create a new Silverlight Application

Uncheck the checkbox [ ] “Host the Silverlight application in a new Web site”. We don’t need to host Silverlight in a separate web app since SharePoint will be the host.


Step 2: You can add the following code at MainPage.xaml for testing if you are new with Silverlight


Build the Application and your Silverlight Application is ready at this stage

Step 3: So, Develop your Silverlight application as per as your requirement. For Example: I developed a application like below. Let’s imagine this application is ready to deploy


Create a Empty SharePoint Project to deploy in SharePoint

Step 4: To Deploy Application in SharePoint

  1. Create Empty SharePoint Project (Run As Administrator) Picture5.png
  2. Leave the sandboxed solution checked and click ok (Pop-up will ask you to choose to deploy as a sandboxed solution or a farm solution.)
  3. Set SharePoint Site URL where you want to deployPicture6.png
  4. Add a new Module to the project
  5. Open the Elements.xml file and Edit the file to include the xap file that will be generated from the Silverlight application
  6. Now your application is ready to be deployed. Right click the SharePoint project and select Set as Startup Project and Deploy Solution.

Add Silverlight Web Part in SharePoint Site

Step 5: On the SharePoint site click the edit icon then the insert tab, select Web Part, and choose the Silverlight Web Part in the Media and Content category


Click Add and in the Silverlight Web Part dialog enter the value from the Url field in the Elements.xml file


Configure Web Part to adjust size.The problem is the default size for the Silverlight Web Part is 400x300 but the application is bigger than 300.


Now Your Silverlight application Deployment Done!


Happy SharePointing!!

Points of Interest

Sometimes Deploy Solution may get when it try to retract old solution. Just try to re-deploy again should solve the problem Smile | :) .


Last Update 13 Jan 2010


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

MJ Ferdous
Architect Brain Station-23
Bangladesh Bangladesh
Ferdous has industry level experience with SharePoint and has done several presentations and workshops on SharePoint. He also worked as SharePoint Consultant (CREDEM Italy, Robi etc) and Trainer (BASIS, JAXARA IT, LEADS Co.). He is currently working as SharePoint Architect at BrainStation-23. He also worked as Technical Project Manager for Congral LLC for managing revolutionizing Patient Centric Healthcare applications at the same company since 2009.

He worked on many international projects during his professional life. The major projects are included below:
Internal Enterprise Portal for Robi, Dhaka
nVision Solution for nSales A/S, Denmark
Shared Care Plan for Congral LLC, USA
Internet Banking Portal for the Bank of CREDEM, Italy
Document Management (DMS) for the Bank of CREDEM, Italy
MES solution for Rockwell Automation, Italy
Tourism for Travel Curve Inc., USA
and so on...

He is the author of several technical articles with over 49 articles published on where he is the Technical Author for the site and author of as well. He is also founder of SharePoint Expert group.

Looking for a Offshore Development or partnership.............. in any development in Dot.Net & Sharepoint 2007,2010 Platform.

Search him in google by 'MJ Ferdous' to get all links, articles, profile etc

Contact him:


Production troubleshooting, maintainability and scalability
SharePoint 2007/2010
Dot.Net Application
Project Management
Document Management Solution

You may also be interested in...

Comments and Discussions

QuestionMissing parts Pin
Paladin201026-Jun-13 5:41
memberPaladin201026-Jun-13 5:41 
GeneralMy vote of 5 Pin
saguptamca17-Jun-13 5:13
professionalsaguptamca17-Jun-13 5:13 
QuestionExcellent tutorial Pin
elun28-Mar-12 10:14
memberelun28-Mar-12 10:14 
AnswerRe: Excellent tutorial Pin
MJ Ferdous28-Mar-12 10:35
memberMJ Ferdous28-Mar-12 10:35 
GeneralMy vote of 5 Pin
Md. Rashim uddin13-Jan-12 0:43
memberMd. Rashim uddin13-Jan-12 0:43 
GeneralRe: My vote of 5 Pin
MJ Ferdous6-Feb-12 20:51
memberMJ Ferdous6-Feb-12 20:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151126.1 | Last Updated 18 Feb 2012
Article Copyright 2012 by MJ Ferdous
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid