Debugging tips - read before posting RRS feed

  • Question

  • Hi folks,

    Here are some common things you should try before posting.


    System.ServiceModel.CommunicationException was unhandled by user code
    Message="The remote server returned an error: NotFound."

    If you get this error, then the WCF service is trying to tell you that something went wrong, but the full error information is not making it back to Silverlight. To fix this problem, add the following line to the MainPage constructor in your Silverlight application. This switches over to the new ClientHttp stack which fixes the problem (you can remove the line when you are done debugging).

    WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);

    You may also need to find this line in your WCF service Web.config file, and change this value to true.

    <serviceDebug includeExceptionDetailInFaults="true"/>

    This should give you much more information in your Silverlight client about what's going wrong. Please remember to remove both of these changes once you are done debugging.

    Next steps

    If the above does not help, try the steps in the this tutorial in MSDN.

    Hope this helps,

    Tuesday, November 24, 2009 8:33 PM