I am starting to use .NET 4.5, which is built into minification and union to minimize and combine my CSS and JavaScript. JavaScript minimization works great, however, I ran into the problem of minimizing CSS. I am creating a style set using the code below -
var myCss = new string[] { "~/Content/jquery.css", "~/Content/app.css", }; bundles.Add(new StyleBundle("~/bundles/MySiteCss/").Include(myCss ));
and then I refer to them in a .cshtml (razor file) as shown below -
@Styles.Render("~/bundles/MySiteCss/")
It minimizes the CSS file. However, if the CSS files contain styles containing help links, such as background-image: url ('img / icon.png'), it tries to load this icon file from a new location (obtained from the package name) = / bundles / MySiteCss / img / icon.png
Since the icon does not exist in the location, it does not load and does not appear on the page.
govin
source share