3

I am using fontawesome 4.5 in my asp.net mvc project. I am facing following error on console enter image description here

I have included fonts in my fonts folder

enter image description here

And line the fontwesome style sheet in layout.cshtml

<link href="~/Content/font-awesome.min.css" rel="stylesheet" />

and my font face attribute is like this

@font-face {
    font-family: 'FontAwesome';
    src: url('../fonts/fontawesome-webfont.eot?v=4.5.0');
    src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');
    font-weight: normal;
    font-style: normal;
}

I have also added static content in my web.config file under system.webServer

 <staticContent>
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="application/font-woff" />

      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
    </staticContent>

and also added MIME type in IIS

enter image description here

still the error remains . Need help to resolve this

Thanks

8
  • Tried this ? <link href="../../Content/font-awesome.min.css" type="text/css" rel="stylesheet" /> Commented Jan 16, 2017 at 10:16
  • Its same see above question Commented Jan 16, 2017 at 10:16
  • Did you change urls in "font-awesome.min.css" file to proper location? Commented Jan 16, 2017 at 10:17
  • See edit , I have included @font-face Commented Jan 16, 2017 at 10:19
  • I have set urls like so in my css file "src: url('../../fonts/fontAwesome/fontawesome-webfont.eot?v=4.5.0');" and it is working. Here is full: pastebin.com/31pH37ty Commented Jan 16, 2017 at 10:20

1 Answer 1

0

Maybe your MIME types is incorrect. Please changes like the following picture.

from application/font-woff2 to font/x-woff2

Setting MIME types

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.