Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法通过nettcp绑定和transfermode=”上载大文件;缓冲的;_C#_.net_Wcf_.net 3.5_Nettcpbinding - Fatal编程技术网

C# 无法通过nettcp绑定和transfermode=”上载大文件;缓冲的;

C# 无法通过nettcp绑定和transfermode=”上载大文件;缓冲的;,c#,.net,wcf,.net-3.5,nettcpbinding,C#,.net,Wcf,.net 3.5,Nettcpbinding,我有一个应用程序,其中一个方法是将文件传输到服务器 我可以轻松上传大约50KB的文件。但我的最大限制是3MB左右 我的WCR服务托管在带有nettcpbinding的windows服务中 我的windows配置是 <configuration> <system.serviceModel> <services> <service name="BTWAServerWindowsService.BatchManagementServ

我有一个应用程序,其中一个方法是将文件传输到服务器

我可以轻松上传大约50KB的文件。但我的最大限制是3MB左右

我的WCR服务托管在带有nettcpbinding的windows服务中

我的windows配置是

<configuration>  
  <system.serviceModel>
    <services>
      <service name="BTWAServerWindowsService.BatchManagementService"
               behaviorConfiguration ="BatchManagementService">
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:9999/BatchManagementService" />
          </baseAddresses>
        </host>
        <endpoint name="BatchManagementServiceEndPoint"
        address =""
        binding="netTcpBinding"
        contract="BTWAServerWindowsService.IBatchManagementService">
        </endpoint>
        <endpoint name="BatchManagementServiceMetadataPoint" address="mex"
                binding="mexTcpBinding"
                contract="IMetadataExchange"/>
      </service>      
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="BatchManagementService">
          <serviceMetadata httpGetEnabled="False"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>       
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

我的客户端配置是

<configuration> 
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="BatchManagementServiceEndPoint" closeTimeout="00:10:00"
          openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
          transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
          hostNameComparisonMode="StrongWildcard" listenBacklog="524288"
          maxBufferPoolSize="524288" maxBufferSize="524288" maxConnections="524288"
          maxReceivedMessageSize="524288">
          <readerQuotas maxDepth="524288" maxStringContentLength="524288"
            maxArrayLength="524288" maxBytesPerRead="524288" maxNameTableCharCount="524288" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
            enabled="false" />
          <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>       
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint address="net.tcp://localhost:9999/BatchManagementService"
        binding="netTcpBinding" bindingConfiguration="BatchManagementServiceEndPoint"
        contract="BTWABatchManagement.IBatchManagementService" name="BatchManagementServiceEndPoint" />      
    </client>
  </system.serviceModel>
</configuration>

目前我还不能将transfermode更改为流媒体,因为还有很多其他方法


请告诉我将我的文件限制提高到4 mb所需的配置更改是什么?请在服务端app.config和客户端app.config的NetCpBinding中更改以下属性

maxBufferPoolSize="1073741824" maxBufferSize="1073741824" maxConnections="10"
          maxReceivedMessageSize="1073741824">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
maxBufferPoolSize=“1073741824”maxBufferSize=“1073741824”maxConnections=“10”
maxReceivedMessageSize=“1073741824”>
这些属性的最大值为2147483647

<bindings>
      <netTcpBinding>
        <binding name="BatchManagementServiceEndPoint" closeTimeout="00:10:00"
          openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
          transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
          hostNameComparisonMode="StrongWildcard" listenBacklog="524288"
          maxBufferPoolSize="1073741824" maxBufferSize="1073741824" maxConnections="10"
          maxReceivedMessageSize="1073741824">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
            enabled="false" />
          <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>       
      </netTcpBinding>
</bindings>


希望这有帮助

谢谢德拉。我刚才做的和中提到的一模一样