Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.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
Asp.net 查看XML站点地图IIS Express_Asp.net_Xml_Iis - Fatal编程技术网

Asp.net 查看XML站点地图IIS Express

Asp.net 查看XML站点地图IIS Express,asp.net,xml,iis,Asp.net,Xml,Iis,我正在尝试使用web.sitemap创建站点地图。在尝试查看站点地图时,我遇到了404.7服务器错误,我已将其排序为允许在web.config中使用文件扩展名,但现在我遇到了允许查看文件类型的问题。错误提示我执行以下操作: To set a MIME type, run the following command in the IIS Express install directory: appcmd set config /section:staticContent /+[fileEx

我正在尝试使用
web.sitemap
创建站点地图。在尝试查看站点地图时,我遇到了
404.7服务器错误
,我已将其排序为允许在
web.config
中使用文件扩展名,但现在我遇到了允许查看文件类型的问题。错误提示我执行以下操作:

To set a MIME type, run the following command in the IIS Express install directory: appcmd set     config /section:staticContent /+[fileExtension='string',mimeType='string']
The variable fileExtension string is the file name extension and the variable mimeType string is the file type description.
For example, to add a MIME map for a file which has the extension ".xyz": appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']
当我查看文件夹时,我只看到xml配置文件。 有没有办法在
web.config
中添加MIME类型?还是我必须做IIS的事

我只允许文件类型:

<fileExtensions allowUnlisted="true">
      <remove fileExtension=".sitemap"/>
      <add fileExtension=".sitemap" allowed="true"/>
</fileExtensions>

您还需要mimetype

<staticContent>
  <mimeMap fileExtension=".sitemap" mimeType="application/xml" />
</staticContent>