MVC Bundle altering css content - Font Awesome

Asked

Viewed 250 times

0

I have a problem with Bundle ASP.NET MVC. When I run the local application, the Fontawesome icons are rendered perfectly. Even when I enable the Bundle local.

However, when I publish the application on the server, Bundle changes all the css "content" from the awesome font to "?" and the icons disappear.

I do not believe that it should be anything of the application, because in iisexpress it rotates normally.

bundles.Add(new StyleBundle("~/bundles/style").Include(
                "~/Content/poppins.css",
                "~/Content/bootstrap.min.css",
                "~/Content/font-awesome.min.css",
                "~/Content/animate.css",
                "~/Content/filter.css",
                "~/Content/awesome-bootstrap-checkbox.css",
                "~/Content/bootstrap-datepicker.css",
                "~/Content/bootstrap-select.css",
                "~/Content/jquery.dataTables.css",
                "~/Content/multi-select.css",
                "~/Content/sweetalert.css",
                "~/Content/jstree.css",
                "~/Content/dataTables.select.css",
                "~/Content/bootstrap-tagsinput.css",
                "~/Content/style.css"
        ));

Imagery

Wrong icons (previous) inserir a descrição da imagem aqui

Certain icons (localhost) inserir a descrição da imagem aqui

All content of the font-awesome classes appear as (an example), but only after Bundle, pq the css file is correct:

.fa-user {    
    content: '?';
}
  • I had a similar problem a few days ago, but I can’t remember what caused it.

  • Which is the folder (complete structure based on the root of the application) where the Font Awesome file is?

  • /Content/font-awesome.min.css and fonts are in /fonts/fontaewsome...

  • Please put the file Bundleconfig.Cs

  • I edited with css Bundle. I have tried to change the order and let the font-awesome last, but also not solved.

  • Claudio, the problem there is with the paths. Everything that is "bundlerized" will end up staying in bundles/style, FA’s CSS is probably using the relative paths considering the structure in which it is in Content and so ends up not finding the source file. You installed the FA by the Nuget?

  • Yes, I installed it by nuget. And that doesn’t make sense, because the source files reference, on the font-awesome, is like .. /fonts, so being in /Content or /Bundles, it’s only 1 level below the root.

  • Well, I can’t guess the structure of the folders. You have how to confirm that the folder fonts is accessible for external requests?

Show 3 more comments

1 answer

0

Put the goal in the header?

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

or

<meta charset="utf-8" />
  • Yes, you have the meta tag with charset. I’ve tried it, too

  • your path ta correct, has the meta, has how to Mander the site link for me to look?

  • I can’t because I have to log in and this application is running in production.

  • then put the console error

  • No CSS error appears in the console.

  • then opens the console goes to the Network and gives a refresh on the page, see if it has any status other than 200

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.