I get the following error in my ASP.Net MVC page when running in IIS
downloadable font: download failed (font-family: “FontAwesome” style:normal weight:normal stretch:normal src index:1): status=2147746065 source: http://localhost/MyApp/fonts/fontawesome-webfont.woff?v=4.1.01 sharedStyle:1:126778
The same page running locally, everything works fine. All files are deployed
and the path to FA is C:inetpubwwwrootMyAppContentTemplatefont-awesome-4.1.0
I tried all solutions from Why font-awesome works on localhost but not on web ? and ASP.NET MVC4 Bundling with Twitter Bootstrap
UPDATE:
I added fileExtensions to system.webServer as suggested by Shyju, but it did not change the problem.
Is it possible that there is a problem with bundling? I use it in the following way:
public static void RegisterBundles(BundleCollection bundles)
{
StyleBundle sharedStyleBundle = new StyleBundle("~/bundles/sharedStyle");
sharedStyleBundle.Include("~/Content/Template/font-awesome-4.1.0/css/font-awesome.css");
...
bundles.Add(sharedStyleBundle);
...
}
2
Answers
I had to change the bundling as follows:
It seems to be important, that the key for the bundle has the same structure as the bundle path itself.
IIS does not know how to serve these new types of files. We should explicitly tell that these are good file types.
Add this section to your web.config under
<system.webServer>
section. That should fix it.Sometimes, If it is already added ,you need to remove it and re-add it to avoid possible conflicts/errors.