Asp.net MVC页面为图像文件提供Mime类型警告

时间:2022-02-23 21:22:46

While I do not see any functionally or jquery UI elements affected by this, but when I access my asp.net mvc web page the chrome developer console is logged with a bunch of error messages like so:

虽然我没有看到任何功能或jquery UI元素受此影响,但是当我访问我的asp.net mvc web页面时,chrome开发人员控制台会记录一些错误消息,比如:

Resource interpreted as image but transferred with MIME type application/octet-stream.

将资源解释为图像,但使用MIME类型的应用程序/八进制流传输。

All of the warnings are for jquery UI images (though I don't have any custom images on there so I don't know if it's jquery UI only). All the jquery images still load correctly.

所有的警告都是针对jquery UI镜像的(尽管我没有任何自定义镜像,所以我不知道它是否是仅针对jquery UI的)。所有jquery图像仍然正确地加载。

Does anyone have any insight on why this is happening?

有人知道为什么会这样吗?

1 个解决方案

#1


95  

Are you running your site from Visual Studio's built-in web server? Apparently, you don't have much control over the MIME types in that environment (see this). I was seeing the same behavior and was starting to stress about it before finally realizing that I wasn't even looking at the IIS-hosted application.

您是否在Visual Studio的内置web服务器上运行您的站点?显然,您对该环境中的MIME类型没有太多控制(请参见本文)。我看到了同样的行为,并开始强调它,直到最后意识到我甚至没有看iis托管的应用程序。

#1


95  

Are you running your site from Visual Studio's built-in web server? Apparently, you don't have much control over the MIME types in that environment (see this). I was seeing the same behavior and was starting to stress about it before finally realizing that I wasn't even looking at the IIS-hosted application.

您是否在Visual Studio的内置web服务器上运行您的站点?显然,您对该环境中的MIME类型没有太多控制(请参见本文)。我看到了同样的行为,并开始强调它,直到最后意识到我甚至没有看iis托管的应用程序。