I´m getting trouble with CSS paths in a MVC 4 application. When I´m in the development environment the Paths that points to imgs, for example, works fine. But when the app have been published the paths doesn´t work, leading to invalid URL. I´m using bundles and my config is set to publish, which means "debug mode=off".
I have the following physical Path:
Content\admin\layout\css\themes
Content\admin\layout\img
And in my CSS I have several images mapped like:
background-image: url(../../img/sidebar_toggler_icon_darkblue.png);
Which maps to the "\img" path above.
What is the best option in Asp.net MVC 4 to do the correct Path mapping? I have seen a lot of resources, but they all speak on the tag of css/js. My problem, is with the paths inside CSS.
EDIT 1
I have already seen the URL generated with "F12" in Chrome. It does point to:
MyServer/img/sidebar_inline_toggler_icon_darkblue.jpg
while running local it points to:
localhost:50390/Content/admin/layout/img/sidebar_toggler_icon_darkblue.png
I´m aware that re-writing all css paths should work, but i doubt thats the right to do. I must be missing something.
My bundle is configured as:
bundles.Add(new StyleBundle("~/css").Include(
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.theme.css",
"~/Content/global/plugins/font-awesome/css/font-awesome.css",
"~/Content/global/plugins/simple-line-icons/simple-line-icons.css",
"~/Content/global/plugins/bootstrap/css/bootstrap.css",
"~/Content/global/plugins/bootstrap-switch/css/bootstrap-switch.css",
"~/Content/global/css/components.css",
"~/Content/global/css/plugins.css",
"~/Content/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css",
"~/Content/admin/layout/css/layout.css",
"~/Content/admin/layout/css/themes/darkblue.css",
"~/Content/admin/layout/css/custom.css",
"~/Content/themes/base/jquery.ui.datepicker.css"
));
Have already seen those links, but couldn't find the way:
CSS and Javascript relative path confusion in ASP.NET MVC
CSS/JS bundle in single file in mvc when publish with release option