Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.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
IIS 10:ASP.NET Web.config maxRequestLength未强制执行_Asp.net_Iis 10_Maxrequestlength - Fatal编程技术网

IIS 10:ASP.NET Web.config maxRequestLength未强制执行

IIS 10:ASP.NET Web.config maxRequestLength未强制执行,asp.net,iis-10,maxrequestlength,Asp.net,Iis 10,Maxrequestlength,我正在Windows 10 Pro x64上开发ASP.NET web窗体应用程序。我相信它运行的是IIS 10,因为我的计算机\HKEY\U LOCAL\U MACHINE\SOFTWARE\Microsoft\InetStp\VersionString=Version10。我检查了我的Windows功能,并且安装了Internet信息服务/万维网服务/安全/请求筛选 我的web.config文件中有以下请求大小限制: <system.web> <httpRuntim

我正在Windows 10 Pro x64上开发ASP.NET web窗体应用程序。我相信它运行的是IIS 10,因为我的计算机\HKEY\U LOCAL\U MACHINE\SOFTWARE\Microsoft\InetStp\VersionString=Version10。我检查了我的Windows功能,并且安装了Internet信息服务/万维网服务/安全/请求筛选

我的web.config文件中有以下请求大小限制:

<system.web>
    <httpRuntime requestValidationMode="2.0" maxRequestLength="2048" />
</system.web>


但是,我的应用程序仍然允许我上传4MB的文件。我试图测试当超过最大请求大小限制时会发生什么。但是,我无法让IIS抛出http状态413异常

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