.net mvc url中出现保留文件名时,会提示404的解决方案

类似下面的文件名
info/nul.html
info/aux.html

服务器直接返回404错误提示
查了资料,解决方案如下

web.config中增加如下加粗部分

<configuration>
  <system.web>
    <httpRuntime relaxedUrlToFileSystemMapping="true"/>

    <!-- ... your other settings ... -->
  </system.web>
</configuration>
<httpRuntime relaxedUrlToFileSystemMapping="true"/>

即可完美解决

原文地址:https://www.cnblogs.com/icejd/p/14801445.html