WCF RIA Service Hosting :: Error Message – Load Operation Failed for query “GetUser”

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 />    <add 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.

Comments are closed.



Cheap Reseller Hosting

Best Blog Hosting Provider

Best European ASP.NET 4.0 Hosting Provider