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>