Today, we are going to discuss a common issue that you may find when running WCF RIA service on a shared hosting server. ASPHostCentral.com, as the premier ASP.NET and Windows Hosting provider, proudly presents this article to anyone and we believe it will help many ASP.NET communities; especially to those who are using WCF RIA Service. In case you are looking for WCF RIA Service Hosting, you can always consider ASPHostCentral.com and you can start from our lowest Standard Plan @$4.99/month to host your WCF-service site.

One of the most common errors that you may find when running your WCF RIA Service on a shared hosting server is the error message:  
“Load Operation Failed for query "GetUser"

This is always an annoying issue with Silverlight deployment to do with connection strings and domain authorizations. Basically it’s a very generic error that pops up if you’re using the in-built standard asp.net model, such as the RIA services models of .net/silverlight development using aspnet authorization and registration.
There is a variety of reasons you will get the message popping up, but they all mean that your aspnet authorization calls (once of which is the GetUser call) are not able to contact the database that contains your aspnet data.


Common Reasons

- Your development system is using a local SQL Express database which works fine when your on your own machine, but once its online, it’s still trying to find the same LocalSqlServer or localhost, and obviously cant. You can get round this in your web.config, using stuff like:
     <remove name="LocalSqlServer" />    <add name="LocalSqlServer" connectionString="etc etc".>

- Or possibly you have all the connection strings point to the right places, but your new server database doesnt contain all the necessary aspnet tables/framework. Theres some tools that are located in your windows/.net folders, such as aspnet_regiis.exe, which if you search for online, you willl get details on how to use them to automatically configure/update an sqlserver with the all the necessary aspnet objects.

- You haven not deployed necessary references to the webserver, especially ones such as the System.Web.Ria, System.Web.DomainServices and System.ComponentModel.DataAnnotations. You can select them in your visual studio project and mark the Copy Local propery to True.- Also if you have any services mapped from server to client, such as WCF Services, make sure when your publishing to update their bindings/endpoint addresses in the client, as they will be still looking for those services on the localhost development server.

- Also make sure you use a valid crossdomain.xml and clientaccesspolicy.xml on your web project/deployment. If you do a websearch for these two filenames, you will get lots of examples of various settings to use that might be relevant to your site operation.

Theres also lots of other settings to tweak with your IIS settings that sometimes cause the issues, such as allowed IIS authentications such as anonymous, impersination, forms etc. Some servers run/allow multiple authentications that can cause issues with the aspnet operations of silverlight.

It’s a bit of a minefield, but basically as you can see the problem is a difficult one for so many silverlight developers because there can be so many solutions to fixing the issue.The other alternative that you can consider is you can use mix of setting of the correct IIS authentication allowing anonymous and forms, and making sure the default connection strings were update correctly. As for the stuff on our server, please (if possible) remove ASP.NET authorization from your application and please write your own custom authorization, so it’s not even trying to update the local sql server for the inbuilt ASP.NET stuff.

Hope this helps shed some light.


Reasons to trust your WCF-based website to ASPHostCentral.com

What we think makes ASPHostCentral.com so compelling is how deeply integrated all the pieces are. We integrate and centralize everything--from the systems to the control panel software to the process of buying a domain name. For us, that means we can innovate literally everywhere. We've put the guys who develop the software and the admins who watch over the server right next to the 24-hour Fanatical Support team, so we all learn from each other:

- 24/7-based Support - We never fall asleep and we run a service that is operating 24/7 a year. Even everyone is on holiday during Easter or Christmas/New Year, we are always behind our desk serving our customers
- Excellent Uptime Rate - Our key strength in delivering the service to you is to maintain our server uptime rate. We never ever happy to see your site goes down and we truly understand that it will hurt your onlines business. If your service is down, it will certainly become our pain and we will certainly look for the right pill to kill the pain ASAP
- High Performance and Reliable Server - We never ever overload our server with tons of clients. We always load balance our server to make sure we can deliver an excellent service, coupling with the high performance and reliable server
- Experts in WCF RIA Service Hosting - Given the scale of our environment, we have recruited and developed some of the best talent in the hosting technology that you are using. Our team is strong because of the experience and talents of the individuals who make up ASPHostCentral
- Daily Backup Service - We realise that your website is very important to your business and hence, we never ever forget to create a daily backup. Your database and website are backup every night into a permanent remote tape drive to ensure that they are always safe and secure. The backup is always ready and available anytime you need it
- Easy Site Administration - With our powerful control panel, you can always administer most of your site features easily without even needing to contact for our Support Team. Additionally, you can also install
more than 100 FREE applications directly via our Control Panel in 1 minute!

Happy hosting!