If you are trying to figure out why your WCF RIA Service's method calls(or just the regular WCF Service for that matter) throwing the infamous “
” error, you are at the right place. This is basically Silverlight’s way of telling that an exception occurred while the Silverlight runtime tried to make a service call. So, if you are in a similar situation, here are few options that should resolve this issue.
You will get a variation of an error message like this:
Load operation failed for query 'MyQueryxxxx'. The remote server returned an error: NotFound
Finding out the detailed underlying error would be your first step. By default, the customErrors element of a Web.config file is set to RemoteOnly, which means a remote client will not receive the detailed ASP.NET error information. To debug your application, set customErrors to Off so that you can see the detailed ASP.NET error from the client.
(you may need to perform one or more of the following steps):
#1: Check the database connection string that your Entity Model is using. Make sure the connection string is valid. You can verify it via a simple
#2: Is version of your RIA component on the Server “exactly” same as what you have in your Development machine? They MUST match; otherwise you will get this “Not Found” error. This is one of the most common scenarios that we usually see. You can check the RIA component version via Control Panel:
If they don’t match, uninstall it from the Server and reinstall the version matching with your Development machine.
#3: Does your \bin folder on the Server have another \bin folder inside? If so, you need to remove the extra one:
Above are the most common resolutions for this infamous “Not Found” error. If the above steps don’t resolve your issue, then do a deep dive into tracing the error details. All exceptions originating from within a domain service are sent to the Silverlight client with an error status code of 200. All exceptions thrown at the WCF layer or lower are sent to the Silverlight client with a status code of 404. You can run following traces to get the exact exception information from the server: