zoukankan      html  css  js  c++  java
  • 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 /+[fileExtension='string',mimeType='string']
    2、变量 fileExtension 字符串是文件扩展名,变量 mimeType 字符串是文件类型说明。
    3、例如,要为扩展名为“.xyz”的文件添加 MIME 映射: appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']

  • 相关阅读:
    sql
    java常见异常
    call的用法及NodeList与Array的区别
    os模块
    random模块
    time模块
    序列化模块
    模块介绍
    内置函数
    匿名函数-lambda
  • 原文地址:https://www.cnblogs.com/qidian10/p/3289816.html
Copyright © 2011-2022 走看看