The first article describes how to handle the problem through configuration. This article providesCodeThe main idea is to directly paste the class diagram through custom features:
Given the source code, this class is not analyzed in detail. If you have mastered the previous configuration method, it is not difficult to understand the code.
In the service contract, we add the implemented wcferrorbehavior and wcfsilverlightfaultbehavior features.
[Wcferrorbehavior]
[Wcfsilverlightfaultbehavior]
Public ClassTestservice: itestservice
{}
open web. config. You can see that no node is modified. During the runtime, you can see the error message of WCF. For example, the Code section is not described in detail in this article, if you are interested, you can directly study the code. The error handling of Silverlight and WCF has come to an end for a while. I hope you will point out the shortcomings in this article for improvement. Download the code: wcfexceptionhander.rar