VS调试时JSON格式文件无法加载

VS调试时JSON格式文件无法加载

 报错:

解决:在项目中的web.config中进行配置,configuration节中添加以下部份:

  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".json" mimeType="application/json"/>
    </staticContent>
  </system.webServer>

注意:打包,挂在iis上的时候可能提示这句错误,删除就好。

  钻研不易,转载请注明出处。

原文地址:https://www.cnblogs.com/s313139232/p/10215852.html