Sitefinity 3.7 SP4 calling a Silverlight 4 WCF RIA Services app
I have been working with Sitefinity 3.7 SP4 on some of my private (practice) sites for the purposes of developing a software as a solution idea in Silverlight 4.
I have set up a subdomain and have mapped the URL to a particular page where I have a link to the Silverlight test application that is using a DomainServiceClass to open a simple table and display it in a grid.
I have been successful getting to the HTML page that launches the Silverlight 4 application which renders the page after loading Silverlight, but it fails when it attempts to load the data from the service to populate a DataGrid.
I have captured the service call here from Fiddler 2's Request Header section:
The error states that the application cannot load the assembly Telerik.CMS or one of its dependencies. Can you please check if the application was built referencing different version of Sitefinity than the one used on the hosted website?
the Telerik team
Thank you for your reply Radoslav,
Here are some more facts regarding this issue:
1. The Silverlight 4 RIA Service application was compiled using Visual Studio 2010. I used the Siliverlight Line of Business Application Template to create the little application. It is compiled using .NET 4.0 and it works on my local machine, connected remotely to my database instance on WinHost.com (a great hosting service by the way). It also uses Entity Framework 4.0 and the DomainServiceClass to obtain collections for binding from the database.
2. I have some experience linking pages from Sitefinity to external HTML pages and then back again with success. That is how I am linking to this Silverlight 4 WCF RIA Services application, via its generated HTML page.
3. I used the Web Deploy feature of Visual Studio 2010 to deploy the Silverlight application. Everything was fine. I can get to the page and it runs the Silverlight 4 plugin and renders the page.
4. I have used a UrlMapping section in Sitefinity Community 3.7 SP4 (.NET 4.0 compatible) to map a sub-domain to point to a Sitefinity page. On that page, I placed a Hyperlink control and mapped the URL to point to the HTML page that launches the Silverlight 4 LOB application. It works, but it fails to load the simple "Get<TableName>" call that populates the Silverlight 4 DataGrid component (the plain old Microsoft version).
5. One thing I noticed when attempting to launch the Silverlight 4 application the first time was that Sitefinity was searching for the page from ~/App_Master/... (blah, blah, blah) instead of from the Sitefinity (or site's) root. I suspect that Sitefinity last accessed the App_Master folder to load the master page and template for the Sitefinity page I created and was navigating from -- and that it was stuck in that folder.
6. The Silverlight 4 RIA Services application has its own web.config and I am not an expert in IIS7 (but I sure have learned a lot over the past couple of years about it). However, I have been reading various blog entries on the web related to load errors such as mine, so I started copying the key .dll files from Sitefinity's .bin folder to the .bin folder of my Silverlight app using FileZilla one at a time and then reading the response in Fiddler 2.
The success from doing that is such that -- while I still get a failure -- I can work past the missing .dll issues. However, it ends up looking for a default provider that it cannot find. I have read about and seen references to some kind of web.config hierarchy and I am speculating that may be contributing to my problem, e.g., Sitefinity's web.config may "own" the process and the Silverlight 4 RIA Service's web.config is a child of the Sitefinity web.config. I don't know if I am correct on this point, but it seems logical since it appears that the Sitefinity CMS engine has lost its reference to the path to its own bin folder and provider.
If you want me to send anything to you, I'll be glad to do so, but I don't want to publish information that may prove harmful to my site on this blog -- as I am sure you and others understand.
Thanks again for taking time to respond. I am sure this will be a beneficial thread for others to consume (unless they've already figured this out -- and if so -- please feel free to chime in).
Have a good day! Kind regards to you, Ivan and the rest of the Telerik team!
Thank you for all the additional information.
The problem with App_Master path. The thing is that Sitefinity pages consitute of template/master page, the content page and the controls added to pages. If a rooted path (for html elements) or application relative one (for ASP.NET controls) is not used the path will be resolved to a wrong location. You are getting the reference to App_Master since the master page is there and for some reason when the link is rendered it thinks that the current document is located in App_Master.
The problem with the Default provider not being found. Most of the times this error is caused when you try to invoke the Sitefinity Managers in an application which is not the Sitefinity website. For example a third party application which tries to use the Sitefinity API. This is not possible the managers are part from a larger framework which is initialized within the Sitefinity website. This means that all services that use the Sitefinity API must be hosted on the Sitefinity website to run.
the Telerik team