Deploy Silverlight to SharePoint2010
In this post, I’d like to show you how to deploy Silverlight components to SharePoint using Module. You can download the complete source code here.
1. Create empty SharePoint project.
2. Create a Silverlight project in the same solution.
3. Add the following code to the Silverlight project.
4. Create a document library called SLDocLib to store the Silverlight xap file.
5. Add the Module item to deploy the Silverlight xap file to SharePoint.
6. Go to the HelloWorldSL Module property settings, Add Silverlight project to the Project Output References, Set Deployment Type to ElementFile .
7. Deploy the solution and you will see the in the document library called SLDocLib below.
8. Add a Silverlight web part .
9. Type the URL to the xap file in the document library and you will the Silverlight components displayed on the Page.
10. Another way to deploy silver light on the page is to to deploy SharePoint Page using module and in your page using Object tag to link your Silver light xap file.In the link , you can use relative url to link to your silverlight xap file.You can find benefits of using relative url from this SharePointOverflow question here.