Answer – “Unable to Deploy Silverlight Application in Sharepoint Server”
This is the major question and mind boggling problem which we faced, when me and my friend (Sanjiv) was integrating my Silverlight Application with Sharepoint.Scenario – “We developed a Silverlight Media Player in Silverlight 3which has almost all the functionality which are there in normal media player – animated(playlist), Uploading the videos on server(currently synchronously), dynamically fetching the result from the server and populating the playlist, full screen concept, out of browser capabilty. This application was working fine, but when we tried to move a step ahead and tried to integrate the same to sharepoint, we faced lot of problems.”
- How to go ahead and make the our SL application as a webpart in Sharepoint?
- Even though we achieved somehow to make in workable on Sharepoint development box, but we faced a lot of problem on how to Deploy Silverlight Application in Sharepoint?
- Blank page was coming for the silverlight webpart, we were unable to see the Silverlight application in the webpart.
- On Silverlight development box- whole Silverlight development environment.
- On Sharepoint development box – Microsoft Sharepoint 2007, Windows Server 2003, Silverlight 3 SDK, Silverlight tools for VS2008 sp1 and ofcourse – VS2008 with sp1.
- On Sharepoint Server – Windows server 2003, Microsoft Sharepoint 2007.
Steps Followed to get it working –
- As we need to deploy the Silverlight application on Sharepoint server.
- We installed MOSS SP1 (click here to install)
- We Installed WSS SP1 (click here to install) Note: you have to install WSS SP1 even though you have MOSS
- As soon as you install the WSS SP1, all your websites running in the Sharepoint will stop.
- Do not worry about it – You have to go
- This will open for you the following page –
- After completing this we, reset the iis – iisreset.
- Add following file in GAC (C:\windows\assembly) -“System.web.silverlight.dll”
- Now you would be wondering from where does we get the following file from – You need to download the Silverligt 2 sdk and then go to “%Program Files%\Microsoft SDK’s\Silverlight\v2.0\Libraries\Server”.
- After this we followed the blog of “philwicklund.com” and followed all the steps listed there, and we were able to achieve the goal.
- For your comfort I am integrating the same steps here –
- Create a “Content Editor Webpart”
- Then you need to go into your Silverlight aplication and in the ASPX file, copy the code under the <div></div> tag and
- make the following changes – like <div width=”100%” height=”100%” id=”silverlightControlHost”><object id=”xaml” data=”data:application/x-silverlight-2,” type=”application/x-silverlight-2″ width=”100%” height=”100%”> ——- —- —– —– —- </div>
- As you notice here we have declared the width and height in “div” tag also.
- Click “SAVE” button.
- Create a new folder called “ClientBin” within the virtual directories folder of your SharePoint web application.Then deploy the XAP file into that directory.
- Create the New Virtual directory in IIS. Choose ” new”, “virtual Directory” , under Alias type – “ClientBin” as the name of the new directory.
- Then Browse to the “ClientBin” Folder we created under ” virtual directories folder of SharePoint web application” .
- Set the Access permission “Read”, “Run_script” . Click “Finish“.
- Notice here that the ClientBin Folder icon in IIS turned into a Cog form from standard folder icon Then under the “clientBin properties window”, under “virtual directory” tab , set the Execute permission to “Script only”.
- Now, set the MIME types.
- Right click the “ClientBin Folder > properties > httpheaders>Click MIME button” type following –
- All doen and now you can see your webpart in the Microsoft sharepoint.