LP Pinsonneault blog's

Windows 8, Windows Phone, ...


Debugging WCF Web Services

Currently I'm working on a Silverlight project, that retrieve some data from the server using WCF. Sometimes when there is some error the message return to the Silverlight application is : The remote server return an error: Not Found.


This pretty strange because I've flag the set the configuration <serviceDebug includeExceptionDetailInFaults="true" /> and the error doesn’t show up properly. And worst when you do step by step debugging, i won’t show you the error, and the application automatically raise the Completed event of that method you called.

So how can we know the exact error message?

There is a simple way to do that. Implement the System.Diagnostic in the .config file of the WCF application. In my case, it’s in the web.config of the web site hosting the services.

<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
<add name="traceListener"
initializeData= "c:\log\Traces.svclog" />

This will generate a file with some trace that you will be able to analyse with the Microsoft Service Trace Viewer. The application will show you in red where there is some error.


When we click on the line with the error, the right pane is updated to show more detail information regarding the selected trace. Again you will see in red where there is some error.


We then select the current error and the bottom pane will show you the exact error message that you will need.




This error is very simple to fix … but when you get the proper error message!

Hope this will help some of you.


Comments (4) -

That was very informative. Thank you.


Burton Haynes
Burton Haynes

I'll gear this review to 2 types of people: current Zune owners who are considering an upgrade, and people trying to decide between a Zune and an iPod. (There are other players worth considering out there, like the Sony Walkman X, but I hope this gives you enough info to make an informed decision of the Zune vs players other than the iPod line as well.)


Steam Wallet Hack
United States Steam Wallet Hack

This is a topic that is near to my heart... Best wishes! Exactly where are your contact details though?


Pingbacks and trackbacks (1)+

Add comment

  • Comment
  • Preview