How to debug WCF programs

后端 未结 7 1241
执笔经年
执笔经年 2020-12-31 01:21

My code uses lots of WCF calls and when I try to debug it, it doesnt go to the service code itself. Is there a way to debug WCF code somehow?

7条回答
  •  不知归路
    2020-12-31 01:50

    If you are looking to trace the WCF activity to see if the traffic is generated in the correct order, then I would recommend one of the following approaches:

    1) Use fiddler to watch the WCF traffic.

    2) Use the WCF trace listener to monitor the actual WCF calls. This is extremely helpful when trying to determine the causes of serialization failure. You can enable this by adding the following block to your web.config's configuration block:

    
        
          
            
              
            
          
        
      
    

    Double-clicking on the generated file will open up the WCF service log viewer, which will analyze the file for you and allow you to drill into specific calls and see the actual exceptions that occur.

提交回复
热议问题