Add MIME mapping in web.config for IIS Express

I need to add a new MIME mapping for .woff file extensions to IIS Express.

If I add the following snippet to the “applicationhost.config” of IIS Express it works fine:

<staticContent lockAttributes="isDocFooterFileName">
    <mimeMap fileExtension=".woff" mimeType="font/x-woff" />

But I would actually like to do add it to my “web.config” so that not every developer would need to change their “applicationhost.config” locally.

So I removed it again from the “applicationhost.config” file and added the following snippet to the project’s “web.config”:

    <mimeMap fileExtension=".woff" mimeType="font/x-woff" />

Unfortunately it doesn’t seem to work that way because when I try to access a .woff file I end up with a HTTP 404.3 error.

What am I doing wrong?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Putting it in the “web.config” works fine. The problem was that I got the MIME type wrong. Instead of font/x-woff or font/x-font-woff it must be application/font-woff:

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

See also this answer regarding the MIME type:

Update 4/10/2013

Spec is now a recommendation and the MIME type is officially: application/font-woff

Method 2

If anybody encounters this with errors like
Error: cannot add duplicate collection entry of type ‘mimeMap’ with unique key attribute
and/or other scripts stop working when doing this fix, it might help to remove it first like this:

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

At least that solved my problem

Method 3

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

Method 4

I know this is an old question, but…

I was just noticing my instance of IISExpress wasn’t serving woff files, so I wen’t searching (Found this) and then found:

I suppose my install has support for SVG since I haven’t had issue with that. But the instructions are trivially modifiable for woff:

  • Open a console application with administrator privilages.
  • Navigation to the IIS Express directory. This lives under Program Files or Program Files (x86)
  • Run the command:

    appcmd set config /section:staticContent /+[fileExtension=’woff’,mimeType=’application/x-woff’]

Solved my problem, and I didn’t have to mess with some crummy config (like I had to to add support for the PUT and DELETE verbs). Yay!

Method 5

Thanks for this post. I got this worked for using mustache templates in my mvc project
I used the following, and it worked for me.

   <mimeMap fileExtension=".mustache" mimeType="text/html"/>

Method 6

I’m not using IIS Express but developing against my Local Full IIS 7.

So if anyone else get’s here trying to do that, I had to add the mime type for woff
via IIS Manager

Mime Types >> Click Add link on right and then enter
Extension: .woff
MIME type: application/font-woff

Method 7

To solve the problem, double-click the “MIME Types” configuration option while having IIS root node selected in the left panel and click “Add…” link in the Actions panel on the right. This will bring up the following dialog. Add .woff file extension and specify “application/x-font-woff” as the corresponding MIME type:

enter image description here

Follow same for woff2 with application/x-font-woff2

Method 8

I was having a problem getting my ASP.NET 5.0/MVC 6 app to serve static binary file types or browse virtual directories. It looks like this is now done in Configure() at startup. See for a quick primer.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x