Reputation: 10888
I have my WCF Service hosted in Windows Service. The client application is a website project to which I added the Service reference.
I was not using any error logging/tracing... but now I feel I should implement as it will help me not to make void guesses.
Please guide me for the best practice so that I can quickly handle errors and pin point the exact issue.
Thank you!
Upvotes: 1
Views: 2286
Reputation: 4052
If you're looking for general information on debugging WCF services, I recommend reading the following articles:
Debugging WCF Services in Visual Studio 2008
Upvotes: 0
Reputation: 2886
The first step to maintaining a more robust WCF Service is logging all operations made.
The Logging Application Block works for me. you might also want to check log4net.
Upvotes: 1
Reputation: 233125
If you just need to see the error message for troubleshooting purposes, you can set IncludeExceptionDetailInFaults attribute in your app.config. This will give you the full exception details, including a stack trace on your client. However, be aware that exception details may include sensitive information, so don't leave it on in a production system without understanding the risk.
If you want to take it a step further, you can implement the IErrorHandler interface. You can use this as a single point of logging exceptions or translating them into published Fault Contracts.
Upvotes: 3