How to avoid ‘Not Found’ Error when making WCF Service Calls in Silverlight

Have you seen this error message before?  “The remote server returned an error: NotFound.”, Not particularly helpful! This is your Silverlight app’s way of telling you that there was an exception during a WCF Service call. You can fix this with a little WCF server-side magic.  The magic is described in the Silverlight documentation in an entry called Creating and Handling Faults in Silverlight

Here’s the condensed version of the answer.  It all comes down to making your WCF service return a 200 HTTP Status code instead of the default of 400 or 500.  The modification on the server can be made by defining a WCF endpoint behavior for Silverlight faults by implementing the following:

public class SilverlightFaultBehavior : BehaviorExtensionElement, IEndpointBehavior
The above WCF endpoint behavior needs to be configured for in the WCF web.config
        <add name=”silverlightFaults” 
          <behavior name=”SilverlightFaultBehavior”>
        <service name=”Calculator.Web.Service”>
            <endpoint address=”” 
                      behaviorConfiguration=”SilverlightFaultBehavior” />


Here is a little sample application.


Click here to download the source code.

Via How to Permanently Banish Silverlight’s “Not Found” Error for WCF Service Calls


3 thoughts on “How to avoid ‘Not Found’ Error when making WCF Service Calls in Silverlight

  1. Victor, sorry but i am a bit baffled now…on several posts right here you trash talking steroids, and in this
    report you support and advocate a random modest chemical roid capsule.
    ..Why is that? So does that mea, no far more clear training for
    That’s unhappy trigger i truly discovered it truly good, that ultimately i felt like i identified a true non bullshit steroids web site 😦

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s