2

I'm having trouble getting font files to be returned by my IIS. The URLs are correct, the mime-types are set correctly, but I'm still getting 404's. Other static files like JS, CSS, LESS are all returned as expected but the dang font files won't return.

This is for a .NET 4.5 project running MVC4 if that helps.

If I move the font files outside of the application, the files are returned correctly. It is almost as if there is some setting within the .NET application that is preventing the font files from being retrieved.

Thanks in advance for any help and let me know if additional information would be helpful.

Chris Peterson
  • 213
  • 3
  • 8

1 Answers1

1

You probably need to add a MIME type with the file extension of the font.

IIS Can't Serve Certain File Extension

Edit: No, you clearly don't if you've set them already. Incidentally, MIME types can be set on a per-app basis, so you might just want to check the MIME types haven't been overridden in the web.config file. (Searching for the file extension in the web.config file might also net something of interest, or not)

TristanK
  • 8,953
  • 2
  • 27
  • 39
  • I mentioned in the question that the MIME types are already set. I've tried different mime types to no avail. Plus, the server will return the font file when it is moved outside of the application. There are no overriding mime type settings in any web.config on the files either. – Chris Peterson May 16 '14 at 03:07
  • 1
    You did indeed, sorry, I only spot it when I see caps! Using IIS 7.5, you might be able to use Failed Request Tracing to understand which component's preventing the download, and how/why. Install the Tracing feature from Server Manager, then enable it at the Site level (in the Actions pane), then create a rule in the application. Out of interest, what's the file extension for the fonts? – TristanK May 16 '14 at 04:22
  • It is actually blocking .woff, ttf, svg, and eot. I'll see if I can' get more debug info. – Chris Peterson May 16 '14 at 05:21
  • I followed your advice and added the logging. I spit out this huge blob of XML. I'm not sure what I'm supposed to be looking for. Would you mind taking a look? https://dl.dropboxusercontent.com/u/39382497/fr000001.xml – Chris Peterson May 16 '14 at 05:38
  • You can usually just double-click them and that'll format them as a web page using the XSL in the directory. Good news/bad news: there's nothing specifically in IIS blocking it, it's something within the application (i.e. code loaded into the ManagedPipelineHandler) or MVC / routing framework. The BlockViewHandler could be implicated, but it's not instantaneous on entry to that module. There's possibly a system.web setting somewhere causing the problem, but that's the extent of my knowledge. You might find StackOverflow is a better shot for MVC-related questions. – TristanK May 18 '14 at 22:31