1,364 Posts served
5,674 Conversations started
On occasion even the best developers must diagnose issues within their code and with distributed applications this can be a challenging prospect. The Windows Communication Foundation provides extensive tracing that can be enabled within the application domain configuration file (e.g. the App.config or Web.config of your application).
WCF builds upon the tracing capabilities found within the .NET Framework itself using trace sources and trace listeners. Using these capabilities, the WCF team designed the framework to write diagnostics information to trace listeners describing service initialization and the exchange of messages across channels etc.
Within the following Xml segment you can see how easy it is to enable tracing for WCF.
Within the above Xml the source node refers to the System.ServiceModel trace source which is responsible for writing the diagnostics information to the configured trace listeners. It is possible to configure exactly how extensive the trace information will be by selecting one of the possible trace levels within the switchValue attribute as shown here.
It is recommended that you ensure you have selected the appropriate verbosity as the Xml output can easily grow to several thousand lines. Once the Xml has been output it should be formatted using Visual Studio or another Xml editor to improve the readability.
If you'd like to learn more about writing and debugging WCF applications I would recommend reading Essential Windows Communication Foundation and Programming WCF Services by Juval Lowy.
No comments have been posted for this entry yet.