偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

WCF跟蹤調(diào)試具體代碼詳細剖析

開發(fā) 開發(fā)工具
WCF跟蹤調(diào)試的工具主要有兩種,一種是SvcConfigEditor,另一種則為SvcTraceViewer。他們都是由微軟提供的一種輔助工具。

WCF中,有一中比較有用的操作技術(shù),教唆WCF跟蹤調(diào)試,它可以為我們帶來非常大的幫助。在WCF中提供了兩個工具可以進行WCF跟蹤調(diào)試,我主要是用來跟蹤傳輸?shù)膞ml是否符合我定義的schema。#t#

這兩個WCF跟蹤調(diào)試的工具是:

工具路徑:C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin

SvcConfigEditor:微軟提供的用來輔助編輯WCF配置文件的工具

SvcTraceViewer:微軟提供的用來查看WCF的Trace Log的工具。

跟蹤配置

啟動SvcConfigEditor.exe, 用這個程序打開wcf service host程序的web.config 或者app.config,除了WMI Provider,其它的全部Enable, 在log file選擇svclog文件的保存路徑, 然后save, 如果config文件在源碼管理器,記得先簽出,才能保存。

 

也可以手動配置添加如下內(nèi)容,不使用上面的WCF跟蹤調(diào)試工具

< configuration>節(jié)理添加如下內(nèi)容

 

 

  1. < system.diagnostics>   
  2. < sources>   
  3. < source name="System.ServiceModel.MessageLogging" 
    switchValue="Warning, ActivityTracing">   
  4. < listeners>   
  5. < add type="System.Diagnostics.DefaultTraceListener" name="Default">   
  6. < filter type="" />   
  7. < /add>   
  8. < add name="ServiceModelMessageLoggingListener">   
  9. < filter type="" />   
  10. < /add>   
  11. < /listeners>   
  12. < /source>   
  13. < source name="System.ServiceModel" 
    switchValue="Warning, ActivityTracing"   
  14. propagateActivity="true">   
  15. < listeners>   
  16. < add type="System.Diagnostics.DefaultTraceListener" name="Default">   
  17. < filter type="" />   
  18. < /add>   
  19. < add name="ServiceModelTraceListener">   
  20. < filter type="" />   
  21. < /add>   
  22. < /listeners>   
  23. < /source>   
  24. < /sources>   
  25. < sharedListeners>   
  26. < add initializeData="E:\Web_messages.svclog"   
  27. type="System.Diagnostics.XmlWriterTraceListener, 
    System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
       
  28. name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">   
  29. < filter type="" />   
  30. < /add>   
  31. < add initializeData="E:\Web_tracelog.svclog"   
  32. type="System.Diagnostics.XmlWriterTraceListener, System, 
    Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
       
  33. name="ServiceModelTraceListener" traceOutputOptions="Timestamp">   
  34. < filter type="" />   
  35. < /add>   
  36. < /sharedListeners>   
  37. < trace autoflush="true" />   
  38. < /system.diagnostics> 

 

< System.ServiceMode>節(jié)里會添加

 

 

  1. < diagnostics>   
  2. < messageLogging logEntireMessage="true" logMalformedMessages="true"   
  3. logMessagesAtTransportLevel="true" />   
  4. < /diagnostics> 

查看

啟動SvcTraceViewer, 打開剛才的svclog文件,調(diào)用wcf service,然后就可以看到消息的記錄。以上就是我們?yōu)榇蠹医榻B的WCF跟蹤調(diào)試的相關(guān)方法。

責任編輯:曹凱 來源: 博客園
相關(guān)推薦

2009-12-07 18:43:29

WCF框架

2010-02-23 16:07:39

2010-03-02 09:39:11

保護WCF服務(wù)

2010-02-25 13:40:17

WCF禁用安全配置

2010-02-22 10:01:11

WCF消息處理

2010-02-23 09:34:15

WCF重載

2010-02-22 16:09:33

WCF宿主

2010-02-22 15:27:05

WCF數(shù)據(jù)契約

2009-11-09 11:15:06

WCF消息隊列

2010-02-26 10:24:43

Python源代碼

2010-02-24 16:17:09

WCF獲取客戶端IP

2010-03-02 16:15:59

WCF控制事務(wù)

2009-11-06 09:14:14

WCF可靠性

2010-02-22 16:26:47

WCF傳輸數(shù)據(jù)

2010-03-02 13:43:01

WCF事務(wù)演示

2010-03-02 16:28:11

WCF發(fā)布訂閱

2009-12-08 17:56:16

WCF配置

2009-06-25 16:03:29

Netbeans調(diào)試

2009-12-08 10:21:17

WCF地址

2010-02-25 14:26:48

WCF特點
點贊
收藏

51CTO技術(shù)棧公眾號