In this exercise we will configure a configuration file for diagnostics. When you install VS2008, you get the Windows SDK 6.0A installed. This includes a "Service Configuration Editor" to edit the configuration for diagnostics and a "Service Trace Viewer" for tracing as below: Task 1: Start the Service Configuration Editor and open the "App.Config" file of the host application. Task 2: Select Messaging Logging from the Diagnostic, and from the "General" set "LogEntireMessage" to "True" as below:Task 3: Select "Diagnostic" from the "Configuration" Pane and from the "Disgnostic" panel, enable "Log Auto Flush", enable "Message Logging", enable Tracing to "Information" as below:Task 4: Expand "Listeners" from the "Configuration", you will have "ServiceModelTraceListener" and "ServiceModelMessageLoggingListener" files generated. You will find "App_TraceLog.svclog" and "App_Message.svclog" as below:
Save the changes and repeat the tasks above for the App.Config file of the client application. Task 5: Now run the WCF Host and Client application and click on the "Add" and "Get Data" buttons. Task 6: Open the "Service Trace Viewer" and open both the "TraceLog" and "Messagelog" file from the host application, you will get the following result:Select the "Message" Tab, select any message and for that message select "XML", you will find values in plain text format.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: