WebClient无法上传大文件。 IISconfiguration

为了给出一个背景,我正在使用IIS8 ,我有一个WCF服务,我的WinForms客户端用于所有的工作。 我也有一个使用uploadFileDownloadFile方法的webclient 。 我有这段代码添加到我的networkingconfiguration。

 <httpRuntime maxRequestLength="51200" executionTimeout="600" /> 

一切都工作正常,突然有一天,我上传了一个接近43 MB的文件,它给了我一个404 (Not found) error 。 我可以find堆栈溢出的一些解决scheme,并添加了这个代码的另一点到webconfiguration,因为它是IIS7和更高版本。

  <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="51200000"></requestLimits> </requestFiltering> </security> </system.webServer> 

这解决了404 error的问题,但现在我得到的错误说

 The request was cancelled. The request was aborted. 

我知道问题是由于httprequest超时,但我无法弄清楚我可以在哪里configuration它。 executionTimeout已经设置,但是我的进程在90秒后退出,这是默认值。 我已经尝试了请求的KeepAlive ,但即使这也没有帮助。

如果可能在configuration上进行更改,而不是客户端代码,这将是非常有帮助的。 有没有办法做到这一点? 谢谢

你有没有在wcf服务的web.config中设置exectionTimeout? WCF有一个方法来设置通过configuration超时。 这里是一个更详细的描述链接

http://msdn.microsoft.com/en-us/library/ms733051.aspx