Css & Js Files Not Rendered When Deploy Of Asp.net Mvc Application On Iis 8 (windows 8)
Solution 1:
I solved the problem!
Thanks to Bundling & minification not applying css & js using Asp.net 4.0 C# !
All I had to do is to change in my bundleConfig.cs file the name from :
bundles.Add(new StyleBundle("~/Content/Theme").Include(
"~/Content/bootstrap.css",
"~/Content/bootstrap-theme.css",
"~/Content/Theme/css/bootstrap-admin-theme.css",
"~/Content/Theme/css/site.css"));
to
bundles.Add(new StyleBundle("~/Content/allcss").Include(
"~/Content/bootstrap.css",
"~/Content/bootstrap-theme.css",
"~/Content/Theme/style/bootstrap-admin-theme.css",
"~/Content/Theme/style/site.css"));
Solution 2:
The answer by the author is correct but its not helpful. I had to look a little more deeper to solve this issue. I found that when you release the application to production or whatever reason and your bundle.config file is not configured properly then you will have CSS/JS not rendered problem. In order to solve this i had to make some changes in bundle.config file. All the style files in the same folder go under one Virtual path and if you have other CSS files that are located under different folder you have to create a new bundle for those. e.g. i had my custom css called "site.css" and "bootstrap.css" in same folder so i created
bundles.Add(new StyleBundle("~/Content/allcss").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"
));`
Then i also had font-awsome which i wanted to include in the project. so i created another bundle
bundles.Add(new StyleBundle("~/Content/css/font-awsome").Include(
"~/Content/css/font-awesome.css"
));
And afterwards i add both paths to my Layout.cshtml file.
@Styles.Render("~/Content/allcss")
@Styles.Render("~/Content/css/font-awsome")
Works like a charm.
Solution 3:
If the website is SSL secured, make sure you have a fully qualified address for your resources. That is the first thing that comes to my mind.
-G
Post a Comment for "Css & Js Files Not Rendered When Deploy Of Asp.net Mvc Application On Iis 8 (windows 8)"