Sitefinity 3.7 SP4 calling a Silverlight 4 WCF RIA Services

Posted by Community Admin on 04-Aug-2018 03:50

Sitefinity 3.7 SP4 calling a Silverlight 4 WCF RIA Services app

All Replies

Posted by Community Admin on 17-Aug-2011 00:00

Hello there,

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:

GET /App_Master/<TestPageNameInSF37SP4>/RiaBusApp/ClientBin/RiaBusinessApp-Web-Services-DomainService1.svc/binary/Get<TableName> HTTP/1.1
I have been able to run this from my own computer over the web to the same database with success, but on the host, it fails with an HTTP 500 with the following output from Fiddler 2's TextView pane:
        <title>Configuration Error</title>
         body font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;
         p font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px
         b font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px
         H1 font-family:"Verdana";font-weight:normal;font-size:18pt;color:red
         H2 font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon
         pre font-family:"Lucida Console";font-size: .9em
         .marker font-weight: bold; color: black;text-decoration: none;
         .version color: gray;
         .error margin-bottom: 10px;
         .expandable text-decoration:underline; font-weight:bold; color:navy; cursor:hand;
    <body bgcolor="white">
            <span><H1>Server Error in '/App_Master/<TestPageNameInSF37SP4>/RiaBusApp' Application.<hr width=100% size=1 color=silver></H1>
            <h2> <i>Configuration Error</i> </h2></span>
            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
            <b> Description: </b>An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
            <b> Parser Error Message: </b>Could not load file or assembly 'Telerik.Cms' or one of its dependencies. The system cannot find the file specified. (<DriveLetter>:\web\<HostedLocationSubDir>\web.config line 103)<br><br>
            <b>Source Error:</b> <br><br>
            <table width=100% bgcolor="#ffffcc">
Line 101:    </profile>
Line 102:    <httpModules>
<font color=red>Line 103:      <add name="Cms" type="Telerik.Cms.Web.CmsHttpModule, Telerik.Cms" />
</font>Line 104:      <!-- Http Module for extension mappings in Library module.-->
Line 105:      <!--<add name="LibraryModule" type="Telerik.Libraries.LibraryHttpModule, Telerik.Libraries"/>--></pre></code>
            <b> Source File: </b> (<DriveLetter>:\web\<HostedLocationSubDir>\web.config<b>    Line: </b> 103
            <hr width=100% size=1 color=silver>
            <b>Version Information:</b> Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
[ConfigurationErrorsException]: Could not load file or assembly 'Telerik.Cms' or one of its dependencies. The system cannot find the file specified. (<DriveLetter>:\web\<HostedLocationSubDir>\web.config line 103) (<DriveLetter>:\web\<HostedLocationSubDir>\web.config line 103)
   at System.Web.Configuration.HttpModuleAction.get_Entry()
   at System.Web.Configuration.HttpModulesSection.CreateModules()
   at System.Web.HttpApplication.InitModules()
   at System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers)
   at System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context)
   at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
   at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)

As you can see I am running ASP.NET 4.0 and have tried this with Anonymous as well as Forms Authentication and with Anonymous authentication exclusively. If you want I can send you a link to the Silverlight 4 application for the Host I am on ( -- whom supports Sitefinity with "Full Trust" by the way).

Thanks again in advance! I know this is the older version of Sitefinity but if it isn't too much trouble I would like to know what I need to do, if it will work or not, or if I need to reconfigure/study/pull more hair out, etc. <g>

Steve 8^P

Posted by Community Admin on 19-Aug-2011 00:00

Hello Steve,

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?

Kind regards,
Radoslav Georgiev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 19-Aug-2011 00:00

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 (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!

Posted by Community Admin on 24-Aug-2011 00:00

Hi Steve,

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.

Radoslav Georgiev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

This thread is closed