【发布时间】:2016-12-27 07:40:47
【问题描述】:
使用 MVC 5,我在我的应用程序中包含了 Fontello 图标。 我的字体文件夹中有以下文件类型: eot、ttf、woff、woff2、svg
在本地运行应用程序,图标看起来不错,但在 Azure 中运行时却不显示。
按照以下建议: http://codingstill.com/2013/01/set-mime-types-for-web-fonts-in-iis/ ,我在 web.config 中添加了以下代码:
<system.webServer>
<staticContent>
<remove fileExtension=".eot" />
<remove fileExtension=".ttf" />
<remove fileExtension=".svg" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
</staticContent>
</system.webServer>
这没有帮助,图标仍然不显示,我收到以下控制台错误:
The link http://{myapplication}.azurewebsites.net/fonts/font/fontello.woff?50484361 Failed to load resource: the server responded with a status of 404 (Not Found)
但我只为 5 种文件类型中的 3 种获得此信息:(ttf、woff 和 woff2)。
注意:文件确实存在,并且在正确的位置!
有什么想法吗?
【问题讨论】:
-
您能分享一个指向您的 Web 应用程序的链接吗?我想知道这是否与捆绑有关?
标签: asp.net-mvc azure fonts azure-web-app-service fontello