404在Azure上的静态内容(SVG,WOFF,TTF​​) [英] 404 on static content (svg,woff,ttf) on Azure

查看:152
本文介绍了404在Azure上的静态内容(SVG,WOFF,TTF​​)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图引导 glyphicons-半身-regular.svg 添加到我的网站。当地一切正常,但在Azue我有404错误:

I am trying to add bootstrap glyphicons-halflings-regular.svg to my web site. Locally everything works fine, but on Azue I have 404 errors:

您正在查找的资源已被删除,有其名
  更改,或者暂时不可用。

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

或当我部分添加以下 staticContent 来我的web.config

or when I add below staticContent section to my 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>

我得到这个错误:

I got this error:

有关路径控制器
  /Content/fonts/glyphicons-halflings-regular.woff未找到或
  没有实现一个IController。

The controller for path '/Content/fonts/glyphicons-halflings-regular.woff' was not found or does not implement IController.

应该如何正确配置我的ASP.NET站点,以避免上述错误?

How should I proper configure my ASP.NET site to avoid above errors?

推荐答案

我不包括在溶液中的字体文件。这造成的出版网站不包含此文件。

I did not include font files in solution. This caused that publishing website does not contains this files.

这篇关于404在Azure上的静态内容(SVG,WOFF,TTF​​)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆