我正在尝试将 bootstrap glyphicons-halflings-regular.svg
添加到我的网站。在本地一切正常,但在 Azue 上我遇到 404 错误:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
或者当我将以下 staticContent
部分添加到我的 web.config
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".ttf" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
我收到此错误:
The controller for path '/Content/fonts/glyphicons-halflings-regular.woff' was not found or does not implement IController.
我应该如何正确配置我的 ASP.NET 站点以避免上述错误?
最佳答案
我在 .woff
文件中遇到了同样的问题。将该扩展添加到 web.config
的解决方案工作正常:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
</staticContent>
</system.webServer>
(参见原始解决方案:http://www.codepal.co.uk/show/WOFF_files_return_404_in_Azure_Web_Sites)
关于asp.net - Azure 上的静态内容(svg、woff、ttf)出现 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18897079/