We have many WCF services, we have not been using contract first. So now we have a lot of code that throws exceptions, that are not s开发者_运维技巧pecified in the FaultContracts.
Other than manually inspecting the code. Is there a way to generate FaultContracts or at least get a warning when a FaultContract is missing?
The Microsoft Enterprise Library Exception Handling Block has a feature which allows exceptions to be declaratively mapped to faults at the service boundary level. This means that you don't have to explicitly raise the faults yourself; they will be created for you by the block when an exception reaches a service boundary. See this article for more details.
However this won't help you identify service operations which are missing fault contracts. I'm not aware of a tool which can do this, so you may have to write your own.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论