سؤال

My app is returning:

Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://fitness-2.apphb.com/Assets/font/artill_clean_icons-webfont.woff
Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://fitness-2.apphb.com/Assets/font/artill_clean_icons-webfont.ttf
Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://fitness-2.apphb.com/Assets/font/rtill_clean_icons-webfont.svg#artill_clean_weather_iconsRg

My web config has:

<staticContent>
      <mimeMap fileExtension=".otf" mimeType="font/otf" />
      <mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
      <remove fileExtension=".woff"/>
      <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
    </staticContent>

My file at /Assets/font/artill_clean_icons-webfont.woff has:

Build Action: Content

CSS files within my /Assets/CSS/ folder are working fine, so I know it's not related the Assets folder, rather the font files themselves?

Also I downloaded the build and the fonts are there.

The latest build is deployed, what am I missing here?

هل كانت مفيدة؟

المحلول

Okay so the process I took for my MVC 4 project:

I set each font to be 'Content' - right click on the font file, properties and set Build Action to Content.

I also included in my web.config:

<staticContent>
      <remove fileExtension=".eot" />
      <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
      <remove fileExtension=".ttf" />
      <mimeMap fileExtension=".ttf" mimeType="font/ttf" />
      <remove fileExtension=".otf" />
      <mimeMap fileExtension=".otf" mimeType="font/otf" />
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="font/x-woff" />
    </staticContent>

In the System.WebServer section.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top