2

Why woff2, woff and ttf files are not loaded, however they are exist in "assets" folder? Please suggest!

enter image description here

shazia perween
  • 587
  • 1
  • 8
  • 23

1 Answers1

2

The problem is that those mime types aren't set for your IISExpress instance. Answer originally found here.

Answer 1: This will fix the error for all sites that create that have these file types as a part of their solution and are being run out of IISExpress.

Quoted in part:

Open ApplicationHost.config located in C:\Users\<user>\Documents\IISExpress\config

Locate staticContent section and append the following lines before the closing tag: <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> <mimeMap fileExtension=".woff2" mimeType="application/font-woff" /> <mimeMap fileExtension=".ttf" mimeType="application/octet-stream />

Answer 1: This will fix the error for that particular site, but any others that you create that have these file types as a part of their solution and are being run out of IISExpress will encounter this same issue.

Update the Web.config for your project. Add <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> <mimeMap fileExtension=".woff2" mimeType="application/font-woff" /> <mimeMap fileExtension=".ttf" mimeType="application/octet-stream /> in the staticContent section in system.webServer in configuration.

This should get those annoying errors to go away!

peinearydevelopment
  • 11,042
  • 5
  • 48
  • 76