Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

System.Net.WebException [HttpWebRequest_WebException_RemoteServer]

0.00/5 (No votes)
13 Jun 2013 1  
Frequent error using WCF in Silverlight.

Introduction 

We get this error: "System.Net.WebException The remote server returned an error: Not Found", sometimes while using Silverlight. It's sometimes a nightmare to resolve the error. We can follow small steps to resolve it. 

Background  

Normally, If the service encounters an error while you are calling a method the Silverlight app will get a not found error. 

Using the code 

  1. Using a tool like fiddler is very helpful in finding a problem with a service call.
  2. The "Not Found" error is a generic response to a CommunicationsException that may occur due to an exception that occurs within the service call itself.

While Fiddler is a good tool for examining the requests/responses as well as the resources loaded, your best bet is to enable WCF tracing and use the WCF log viewer.

Under "Tools..." in Visual Studio, use the "WCF Service Configuration Editor". Open the application configuration file for the service that you are testing and under the diagnostics node, you can choose to enable tracing and the logging of messages. (Warning, these files can get very large, so remove them after debugging sessions or make sure that you disable when your debugging is done.)

There is a WCF log viewer that is part of the Platform SDK. After running your application which is calling the service and you receive the error in your application, there will be a "*.svclog" file in the same directory in which your service is running. You can double click on this file (if already associated with the viewer) and you can view all the details of the service calls, messages, responses, etc.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here