Why font-awesome works on localhost but not on web ?

前端 未结 11 1783
感情败类
感情败类 2020-12-02 13:57

I\'m using font awesome in my project(mvc/asp.net). My problem is, I was debugging the project and check on localhost, there was no problem with fo

11条回答
  •  [愿得一人]
    2020-12-02 14:55

    Why font-awesome works on debug mode but not on IIS?

    In Visual Studio, by default, some font files are not including during Publish:

    • .eot
    • .json
    • .ttf
    • .woff

    This is because their build action is set to None, this is by default (on MVC, not sure on WebForms). You must go to the affected file's properties and set it from "None" to "Content".

    enter image description here

    This is how I solved it (not by manually dragging the files as some may suggest)

    Credits goes to this guy: http://edsykes.blogspot.com/2012/09/aspnet-build-actions-with-ttf-eot-and.html

提交回复
热议问题