so all of a sudden my asp mvc 4 bundles stop working:(
I get cancelled as my http status for the bundle URL's.
Any ideas what I do next? I'm using the same virtual paths in my _layout as when it was working
@Styles.Render("~/foundation/stylesheets")
@Scripts.Render("~/foundation/javascripts")
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
//JQUERY STUFF
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-1.*"));
bundles.Add(new ScriptBundle("~/bundles/jqueryplugins").Include(
"~/Scripts/plugins/jquery.placeholder.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui*"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
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"));
//FOUNDATION STUFF
bundles.Add(new ScriptBundle("~/foundation/javascripts").Include(
"~/foundation/javascripts/app.js",
"~/foundation/javascripts/foundation.min.js",
"~/foundation/javascripts/modernizr.foundation.js"));
bundles.Add(new StyleBundle("~/foundation/stylesheets").Include(
"~/foundation/stylesheets/app.css",
"~/foundation/stylesheets/foundation*"));
}
}
This can happen if your bundle path is the same as an actual path. For example, you have your css in /Content/Css and your build your bundle with the same path thus:
bundles.Add(new StyleBundle("~/Content/Css").Include(
"~/Content/Css/normalize.css",
"~/Content/Css/main.css"
));
I had the same issue and after days of trying to figure it out I noticed my jquery version is now 2.x and my bundles are referencing jquery-1.*. I did have problems when updating my site using NuGet last time. I think the crash caused my bundles to get updated, but it did not update my references in code. Hopefully this will save someone days from trying to figure out why it happened to them.
This is what my app generated for me when I created it:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.*"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With