搜索泥称 发表于 2015-8-16 12:26:00

Visual Studio IIS Express 不支持.json后缀的mime类型

  vs默认web调试工具中并不支持.json后缀的mime类型。
  如何解决,两个方案:
  局部单应用:web.config:



<system.webServer>
。。。。   
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/x-javascript" />
</staticContent>
</system.webServer>
  还一个方案,IIS Express全局(未测试):
  1、若要设置 MIME 类型,请在 IIS Express 安装目录中运行以下命令: appcmd set config /section:staticContent /+
2、变量 fileExtension 字符串是文件扩展名,变量 mimeType 字符串是文件类型说明。
3、例如,要为扩展名为“.xyz”的文件添加 MIME 映射: appcmd set config /section:staticContent /+
页: [1]
查看完整版本: Visual Studio IIS Express 不支持.json后缀的mime类型