Posted on 8/10/2011

Using Silverlight 4 and Ria Services for a web site with authentication sounded like a good idea. Until it came time to publish and view the web site. The UI loaded and everything looked in place, but then…

Load operation failed for query 'GetUser'. The remote server returned an error: NotFound.

After reading several blogs and finding lots of possible solutions – most for Silverlight 3 -  this is what finally worked for me.

First set Copy Local = True in the properties of the following files:

System.ServiceModel.Activation

System.ServiceModel.DomainServices.EntityFramework

System.ServiceModel.DomainServices.Hosting

System.ServiceModel.DomainServices.Server

This did not solve the problem – but I think in combination with the following changes it contributed to the solution. Sorry, but I was too tired to back out of this and test everything from the beginning – maybe another day.

Anyway, in web.config add the following lines:

<system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true"> 
        <baseAddressPrefixFilters>
            <add prefix="http://www.YourWebSite.com"/>
        </baseAddressPrefixFilters>
        </serviceHostingEnvironment>         
</system.serviceModel>

Then use IIS manager to open the web site. Disable the Basic Authentication and make sure Forms Authentication is enabled.

image

Publish the web site!