加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc-4 – 尽管设置了配置值,但超出了最大请求长度

发布时间:2020-12-16 06:49:24 所属栏目:asp.Net 来源:网络整理
导读:当我使用我正在处理的MVC应用程序上传大于4MB的文件到blob存储时,我遇到了一些问题.我在web.config中添加了必要的代码,如下所示: 在system.web中 httpRuntime maxRequestLength="1048576" executionTimeout="3600" / 在system.webserver中 security request
当我使用我正在处理的MVC应用程序上传大于4MB的文件到blob存储时,我遇到了一些问题.我在web.config中添加了必要的代码,如下所示:

在system.web中

<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />

在system.webserver中

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="1073741824" />
  </requestFiltering>
</security>

我已经重建了我的web项目和我的azure项目,但我仍然得到超出最大请求长度的错误.可能导致这种情况的任何想法?堆栈跟踪如下:

[HttpException(0x80004005):超出最大请求长度.]
???System.Web.HttpRequest.GetEntireRawContent()12603644
???System.Web.HttpRequest.GetMultipartContent()221
???System.Web.HttpRequest.FillInFormCollection()357
???System.Web.HttpRequest.EnsureForm()110
???System.Web.HttpRequest.get_Form()16
???System.IdentityModel.Services.WSFederationAuthenticationModule.IsSignInResponse(HttpRequestBase request)32
???System.IdentityModel.Services.WSFederationAuthenticationModule.CanReadSignInResponse(HttpRequestBase request,Boolean onPage)129
???System.IdentityModel.Services.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender,EventArgs args)152
???System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()80
???System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean& completedSynchronously)165

解决方法

我有类似的问题,问题很愚蠢

在我的web.config中,已经有一个指定了targetFramework属性的httpRuntime标记.

我创建了第二个httpRuntime标记,而不是在已经存在的httpRuntime标记中添加maxRequestLength.所以我的价值被忽略了.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读