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
C# 使IIS 7.5将*.xml请求传递到asp.net_C#_Asp.net_Iis - Fatal编程技术网

C# 使IIS 7.5将*.xml请求传递到asp.net

C# 使IIS 7.5将*.xml请求传递到asp.net,c#,asp.net,iis,C#,Asp.net,Iis,如何将IIS 7.5配置为将所有*.xml文件请求转发到asp.net引擎,以便在Global.asax中处理它们并重写*.aspx文件的路径?现在IIS希望直接在磁盘上找到它们。我将使用此选项动态生成我的sitemap.xml您可以通过编辑web.config强制静态文件通过ASP.NET管道: <system.webServer> <handlers> <add name="XMLHandler" type="System.Web.Stati

如何将IIS 7.5配置为将所有*.xml文件请求转发到asp.net引擎,以便在Global.asax中处理它们并重写*.aspx文件的路径?现在IIS希望直接在磁盘上找到它们。我将使用此选项动态生成我的sitemap.xml

您可以通过编辑web.config强制静态文件通过ASP.NET管道:

<system.webServer>
    <handlers>
      <add name="XMLHandler" type="System.Web.StaticFileHandler" path="*.xml" verb="GET"  />
    </handlers>
</system.webServer>



  • 为了做到这一点,你应该使用自定义http处理程序。但是考虑到这一点,我不知道你为什么要这样做。可能是一个更好的路线采取动态网站地图。