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
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.
– Jéf Bueno
Which is the folder (complete structure based on the root of the application) where the Font Awesome file is?
– Jéf Bueno
/Content/font-awesome.min.css and fonts are in /fonts/fontaewsome...
– Claudio Neto
Please put the file Bundleconfig.Cs
– Jéf Bueno
I edited with css Bundle. I have tried to change the order and let the font-awesome last, but also not solved.
– Claudio Neto
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?– Jéf Bueno
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.
– Claudio Neto
Well, I can’t guess the structure of the folders. You have how to confirm that the folder
fonts
is accessible for external requests?– Jéf Bueno