0

Font awesome icons are not displaying in the test IIS environment, but they are displaying in the localhost environment.

I see the following error in the Console for fa-solid-900.woff2:1, fa-solid-900.woff:1 and fa-solid-900.ttf:1: Failed to load resource: the server responded with a status of 404 (Not Found)

The following is a URL path for one of the files: https://projectName.companyName.com/webfonts/fa-solid-900.woff2

The files are located in the following directory path: C:\projectName\wwwroot\Content\webfonts

If I copy the webfonts folder to the following directory, the font awesome icons work: C:\projectName\wwwroot\webfonts

What should I change/update to keep the webfonts folder under the \Content folder and still have the font awesome icons work?

  • You can try to publish your project in the folder where the Content folder is located. – samwu Jul 11 '22 at 02:15
  • I would like to maintain the same structure. In the wwwroot folder, the following folders exist: Areas (where application folders reside), bin, Content, Images, Models, Scripts and Views. Is there a file that I can update to get the solution to reference the webfonts folder under the Content folder? –  Jul 11 '22 at 14:31
  • That seems impossible. – samwu Jul 13 '22 at 05:50
  • I am not sure what changed because it used to work with that directory structure before. I believe that it is the default directory structure. –  Jul 13 '22 at 14:02
  • I'm facing the same issue, and I use stylebindle in my project. If you have same situation as me, you can try to [use CssRewriteUrlTransform](https://stackoverflow.com/a/11386982/7687666). There are also complaints that this method doesn't work, so you can try it. I need to wait until next month to have time to deploy the new version and look forward to your test results.. – Jason Pan Jul 14 '22 at 09:39

1 Answers1

0

The issue ended up being publishing the project to the test environment with the Configuration option set to Release instead of Debug.