我有一個 wpf 應用程式并想byte[]使用NetTcpBinding但有
QuotaExceededException: The maximum message size quota for the remote channel has been exceeded. For more information, see the server logs
我在檔案中看到“MaxBufferSize”和“maxReceivedMessageSize”,但沒有幫助。
服務應用程式.config
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IService"
maxBufferSize="20971520"
maxBufferPoolSize="20971520"
maxReceivedMessageSize="20971520"
>
<readerQuotas maxDepth="32"
maxArrayLength="20971520"/>
</binding>
</netTcpBinding>
</bindings>
和我的客戶,從服務參考自動生成的完整配置,除了系結屬性
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IService"
maxBufferSize="20971520"
maxBufferPoolSize="20971520"
maxReceivedMessageSize="20971520"
>
<readerQuotas maxDepth="32"
maxArrayLength="20971520"/>
<security>
<transport sslProtocols="None" />
</security>
</binding>
</netTcpBinding>
</bindings>
我也嘗試獲取日志(在客戶端)
<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Warning,ActivityTracing">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelMessageLoggingListener">
<filter type="" />
</add>
</listeners>
</source>
<source propagateActivity="true" name="System.ServiceModel" switchValue="Warning,ActivityTracing">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="L:\Projects\Service\Client\Client\App_messages.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
<add initializeData="L:\Projects\Service\Client\Client\App_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
但它只是不起作用!它甚至不生成 .svclog 檔案。我在這里看到了很多關于這個問題的主題,但我找不到任何可以幫助我的東西。唯一的希望是當地的主宰
uj5u.com熱心網友回復:
在<endpoint>服務方面,您應該添加bindingConfiguration="myBind"到您的系結中,例如
<binding name="NetTcpBinding_IService"
transferMode="Buffered"
maxBufferPoolSize="20971520"
maxBufferSize="20971520"
maxReceivedMessageSize="20971520"/>
<services>
<service name="name">
<endpoint bindingConfiguration="NetTcpBinding_IService"
address="you address"
binding="netTcpBinding" contract="you contract"/>
</service>
</services>
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/438156.html
上一篇:高級查詢計數日期
