Reputation: 594
We were able to solve the problem regarding the rendering of Fonts during release in VS2013.
The font urls in "app.css" and "style.css" fonts is pointing to a location for example "fonts/icomoon.eot" which technically it cannot find the specific path based on the directory browsing of the IIS.
We changed it by adding "/Content/stylesheets/" to all of the current font urls which would look like"/Content/stylesheets/fonts/icomoon.eot" and it WORKED.
However we still do not understand as to why debug mode was okay with the previous urls of our css files and fonts are rendering fine.
Can you suggest any fix? or is this fix of ours okay (manually editing the font-urls inside the css files)?
Upvotes: 2
Views: 2823
Reputation: 594
We have found a better solution for the font issues.
The asp.net bundling was the source as to why their was a different result between debug and release mode.
By default, if compilation is on debug mode, the bundling is turned off while if it is on release mode, it is turned on.
To fix that issue we have turned off the asp.net bundling while on release mode by adding this lines to BundleConfig.Cs.
BundleTable.EnableOptimizations = false;
What asp.net bundling does is it creates a virtual directory for all the css and js files. The problem is that it cannot find the path of the urls (specifically the fonts) inside the css files.
But another solution we have tried is:
bundles.Add(new StyleBundle("~/bundles/LayoutCss").Include(
"~/Content/stylesheets/style.css", new CssRewriteUrlTransform() )
.Include("~/Content/stylesheets/app.css", new CssRewriteUrlTransform() )
.Include("~/Content/bower_components/slick/dist/slick.css"));
Upvotes: 2