Geeks With Blogs
Nilesh Baviskar
Dynamics CRM 2011 SDK is providing nice samples and Hands-on but for beginner it takes time to search for simple tasks like this one.
After following this article you will be able to host Silverlight 4.0 application in Dynamics CRM 2011.
We will start with creating the Silverlight application. VS 2010 gives us the template to create “Navigation Application”.
1.       Create Silverlight Navigation Application.
2.       Add button to Mainpage.xaml
3.       Add following code on Click of a button
private void button1_Click(object sender, RoutedEventArgs e)
            MessageBox.Show("SILVERLIGHT BUTTON CLICKED !");
4.       We need to make following small changes to HTML test page. This HTML will be hosted in CRM web resource.
a.       Remove following script
<scrip type="text/javascript" src="Silverlight.js"></script>
b.      Add following script
<script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
c. Add width: 100%; to #silverlightControlHost CSS.
5.       Compile and test the Silverlight application in VS 2010.
6.       Now we will host this application in CRM Dynamics. I’m using Dynamics 2011 “on premise”. We need to create new solution and two web resources to host this SL app.
7.       Create new solution
8.       Create web resource to host XAP.
9.   Now one more web resource to host HTML page
10.   Copy the URL of HTML web resource. URL is generated after you save the web resource.
11.   Publish all the changes.
12.   Test the URL of HTML web resource from IE. You should see something like this
Note : If URL of your web resource have Server Name and it is now working, try replacing it with IP address. I had this issue and I resolved with this solution.


Posted on Tuesday, August 30, 2011 12:06 PM | Back to top

Comments on this post: Hosting Silverlight 4.0 application in Dynamics CRM 2011

# re: Hosting Silverlight 4.0 application in Dynamics CRM 2011
Requesting Gravatar...
helpful info... save my time
Left by aman on Oct 17, 2012 1:45 PM

# re: Hosting Silverlight 4.0 application in Dynamics CRM 2011
Requesting Gravatar...
Thanks for that - very useful.
I have found that I have to change the source line -
<param name="source" value="ClientBin/silvPage.xap"/>

to the CRM resource name -
<param name="source" value="crm_silvPage"/>

CRM does not make this very easy.
Left by Jim Dunstan on Jan 09, 2013 3:34 PM

Your comment:
 (will show your gravatar)

Copyright © Nilesh | Powered by: