2013-04-15 79 views
0

我有Web託管的客戶端端點與桌面應用程序服務端點進行對話。這是在客戶終端側的配置:部署桌面應用程序WCF端點

<system.serviceModel> 
<client> 
<endpoint address="net.tcp://10.8.20.175:3337/NotificationService" 
    binding="netTcpBinding" contract="INotificationService" 
name="NetTcpBinding_INotificationService" /> 
</client> 
<bindings> 
<netTcpBinding> 
<binding sendTimeout="00:10:00" maxReceivedMessageSize="1000000" name="NetTcpBinding_INotificationService"/> 
</netTcpBinding> 
</bindings> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> 

,這是服務端點端配置:通過添加以下

<services> 
<service behaviorConfiguration="NotificationServiceBehavior" 
name="NotificationService"> 
<endpoint address="" binding="netTcpBinding" contract="INotificationService" /> 
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" /> 
<host> 
    <baseAddresses> 
    <add baseAddress="net.tcp://localhost:3337/NotificationService" /> 
    </baseAddresses> 
</host> 
</service> 
</services> 

我試圖打開服務端WCF跟蹤

<system.diagnostics> 
<trace autoflush="true" /> 
<sources> 
    <source name="System.ServiceModel" 
      switchValue="Information, ActivityTracing" 
      propagateActivity="true"> 
    <listeners> 
     <add name="sdt" 
      type="System.Diagnostics.XmlWriterTraceListener" 
      initializeData= "C:\data\logs\trace.log" /> 
    </listeners> 
    </source> 
</sources> 

但是,我沒有得到trace.log生成。

那麼如何獲取桌面應用程序端的跟蹤日誌?謝謝!

+0

是你的專用路徑嗎?文件夾存在。 – evgenyl

回答

0

我沒有看到這一點:

<diagnostics wmiProviderEnabled="false"> 
     <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" /> 
</diagnostics> 

下system.ServiceModel。

試試本指南Setting WCF diagnostics quickly