Reputation: 6027
I am having the problem detailed in this question. I have isolated this as a problem arising only when I build and publish to IIS - even just my local IIS. The site only renders correctly in IE9 in visual studio.
My assumption, based on that is that one (or some) of my assets aren't buuilding correctly. But so far I have been unable to determine what those are (because of the way ASP.Net concatenates everything into bundle files). Is there any easy way to figure out what isn't included?
Bundles in layout
// Bundles in the header
@Styles.Render("~/bundles/themes/crisp/css")
@Scripts.Render("~/bundles/jquery")
@Styles.Render("~/bundles/less")
@Scripts.Render("~/bundles/modernizr")
// Bundle in the footer
@Scripts.Render("~/bundles/themes/crisp/js")
Bundle Config
public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
public static void AddDefaultIgnorePatterns(IgnoreList ignoreList)
{
if (ignoreList == null)
throw new ArgumentNullException("ignoreList");
ignoreList.Ignore("*.intellisense.js");
ignoreList.Ignore("*-vsdoc.js");
ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
//ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
//ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);
}
public static void RegisterBundles(BundleCollection bundles)
{
bundles.IgnoreList.Clear();
AddDefaultIgnorePatterns(bundles.IgnoreList);
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
/*bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));*/
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
/*bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.resizable.css",
"~/Content/themes/base/jquery.ui.selectable.css",
"~/Content/themes/base/jquery.ui.accordion.css",
"~/Content/themes/base/jquery.ui.autocomplete.css",
"~/Content/themes/base/jquery.ui.button.css",
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.slider.css",
"~/Content/themes/base/jquery.ui.tabs.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.theme.css"));*/
bundles.Add(new StyleBundle("~/bundles/themes/crisp/css").Include(
"~/Content/themes/crisp/css/bootstrap.css",
"~/Content/themes/crisp/css/style.css",
"~/Content/themes/crisp/css/socialicoregular.css",
"~/Content/themes/crisp/css/font-awesome.css",
"~/Content/themes/crisp/css/hero-equal-thumb-gallery.css",
"~/Content/themes/crisp/css/tabs-toggle.css",
"~/Content/themes/crisp/css/portfolio.css",
"~/Content/themes/crisp/css/blog.css",
"~/Content/themes/crisp/css/gallery-folio-masonry.css",
"~/Content/themes/crisp/js/fancybox/source/jquery.fancybox.css",
"~/Content/themes/crisp/css/header-1.css"));
bundles.Add(new ScriptBundle("~/bundles/themes/crisp/js").Include(
"~/Content/themes/crisp/js/bootstrap.min.js",
"~/Content/themes/crisp/js/custom.js"));
bundles.Add(new LessBundle("~/bundles/less").Include(
"~/Content/NSA.less"));
}
}
How the scripts are rendered in Visual Studio
<!-- in the header -->
<link href="/Content/themes/crisp/css/bootstrap.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/css/style.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/css/socialicoregular.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/css/font-awesome.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/css/hero-equal-thumb-gallery.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/css/tabs-toggle.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/css/portfolio.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/css/blog.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/css/gallery-folio-masonry.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/js/fancybox/source/jquery.fancybox.css" rel="stylesheet"/>
<link href="/Content/themes/crisp/css/header-1.css" rel="stylesheet"/>
<script src="/Scripts/jquery-1.8.2.js"></script>
<link href="/Content/NSA.less" rel="stylesheet"/>
<script src="/Scripts/modernizr-2.6.2.js"></script>
<!-- in the footer -->
<script src="/Content/themes/crisp/js/bootstrap.min.js"></script>
<script src="/Content/themes/crisp/js/custom.js"></script>
How scripts are rendered in IIS
<!-- in the header -->
<link href="/bundles/themes/crisp/css?v=NGVeO1yylA4mVGqQSoLyRJ2XgdZ-2zTEPUY0ainmzEs1" rel="stylesheet"/>
<script src="/bundles/jquery?v=aLsVjoQ4OTEtRxZ322JRn0RdnugNXJ-_IdXTAvkYpyU1"></script>
<link href="/bundles/less?v=3tti8imykFYimbgfJ7ONprw1J7ZMDbJW1SRykAuV-t81" rel="stylesheet"/>
<script src="/bundles/modernizr?v=wBEWDufH_8Md-Pbioxomt90vm6tJN2Pyy9u9zHtWsPo1"></script>
<!-- in the footer -->
<script src="/bundles/themes/crisp/js?v=gAYGiJLJG_YLR3u47p7oMjS3PzNB2_pXUovgYfVBkv01"></script>
Upvotes: 1
Views: 121
Reputation: 5318
So those scripts that end in 'min' will not be bundled; in your case bootstrap.min.js will not be bundled. Either you have to get the unminified version or rename it.
Additionally you can use Developers tools ( chrome, IE) and inspect if all the csses and the js are rendered.
Upvotes: 1