【问题标题】:Bootstrap. Glyphicons are not loaded on remote server. Folder cannot be found引导程序。字形图标未加载到远程服务器上。找不到文件夹
【发布时间】:2015-06-24 01:13:54
【问题描述】:

我正在使用 Bootstrap v3.3.x 及其字形图标。出于某种原因,在远程服务器上,而不是在本地,找不到带有字体的文件夹,因此没有加载字形图标。在 chrome 调试器中它说:

x GET http://the IP/web 应用文件夹/Content/fonts/glyphicons-halflings-regular.woff .................... ..................... /web 应用程序文件夹/Content/fonts/glyphicons-halflings-regular.woff:1

由于找不到文件而指示错误。

我检查了以下内容:

  • 包括 bootstrap 和 bootstrap-theme 样式表

  • 文件夹fonts与文件夹css处于同一级别:~/Content/css/bootstrap.min.css~/Content/css/bootstrap-theme.min.css~/Content/fonts/

  • 我已将必需的 mimeMap 条目添加到 web.config

<staticContent>
  <remove fileExtension=".eot" />
  <remove fileExtension=".ttf" />
  <remove fileExtension=".otf" />
  <remove fileExtension=".woff" />
  <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
  <mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
  <mimeMap fileExtension=".otf" mimeType="image/svg+xml" />
  <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>

如果我从远程位置加载整个引导库,我还检查了一切是否正常:

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

问题是我下载了带有自定义组件的库,并且必须引用服务器上的库。

干杯

【问题讨论】:

标签: asp.net-mvc twitter-bootstrap


【解决方案1】:

我的问题的原因是 VS2010 在尝试部署应用程序时没有将请求的文件复制到远程服务器文件夹中。我不得不自己复制它们。

为了解决这个问题,我不得不打开窗口Properties,进入Bootstrap的Fonts文件夹,点击那里的每个文件,然后将Build Action设置为Content。 p>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-29
    • 2016-11-16
    • 2019-01-28
    • 2015-12-15
    • 1970-01-01
    相关资源
    最近更新 更多