-1

I am using Bootstrap v3.3.x along with its glyphicons. For some reason, on remote server, not locally, the folder with fonts cannot be found and therefore glyphicons are not loaded. In chrome debugger it says:

x GET http://the IP/web app folder/Content/fonts/glyphicons-halflings-regular.woff .............................................. /web app folder/Content/fonts/glyphicons-halflings-regular.woff:1

indicating the error because the file cannot be found.

I checked the following:

  • both bootstrap and bootstrap-theme style sheets are included

  • folder fonts is at the same level as folder css: ~/Content/css/bootstrap.min.css, ~/Content/css/bootstrap-theme.min.css, and ~/Content/fonts/

  • I have added required mimeMap entries to 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>

I also checked that everything works if I load the whole bootstrap library from remote locations:

<!-- 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>

The problem is that I downloaded library with customized components and has to refer to library on the server.

Cheers

leppie
  • 115,091
  • 17
  • 196
  • 297
Celdor
  • 2,437
  • 2
  • 23
  • 44
  • http://stackoverflow.com/questions/20563001/bootstrap-icons-not-showing-in-published-asp-net-mvc-application – rogerdeuce Apr 17 '15 at 14:25

1 Answers1

0

The reason for my problem is that VS2010 was not copying the requested file into remote server folder when tried to deply the application. I had to copy them myself.

To solve the problem, I had to open window Properties, go to Bootstrap's Fonts folder, click on each file there, and set Build Action to Content.

Celdor
  • 2,437
  • 2
  • 23
  • 44