web.config中的maxRequestLength发生内部错误 [英] maxRequestLength in web.config makes an internal error
本文介绍了web.config中的maxRequestLength发生内部错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想允许我的用户上传大文件,所以我将web.config更改为此:
I want to allow my users to upload files with huge size so I change my web.config to this:
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" >
<section name="delegatezanjan.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken="/>
</assemblies>
</compilation>
<httpRuntime/>
<httpRuntime maxRequestLength="200000" executionTimeout="99999"/>
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="smsSendWebServiceSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://aryanmsg.ir/smsSendWebService.asmx"
binding="basicHttpBinding" bindingConfiguration="smsSendWebServiceSoap"
contract="ServiceReference1.smsSendWebServiceSoap" name="smsSendWebServiceSoap" />
</client>
</system.serviceModel>
<applicationSettings>
<delegatezanjan.Properties.Settings>
<setting name="delegatezanjan_ir_smsline_webservice_SMS_WebServer_Service"
serializeAs="String">
<value></value>
</setting>
</delegatezanjan.Properties.Settings>
</applicationSettings>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
在添加此部分之前,我的代码可以工作,但是在添加最后三行之后,我的网站返回了500个内部服务器错误:
Before adding this part my code is worked, but after adding the the last 3 lines, my website returns a 500 internal server error:
您要查找的资源有问题,无法显示.
There is a problem with the resource you are looking for, and it cannot be displayed.
推荐答案
将其用作答案:)
您已经在配置中两次声明了httpRuntime.你有
You've declared httpRuntime twice in your config. You have
<httpRuntime />
以及
<httpRuntime maxRequestLength="2000000000" executionTimeout="99999999"/>
这篇关于web.config中的maxRequestLength发生内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文