2

I have the following in my BundleConfig.cs file to set up two bundles that I am trying to render.

bundles.Add(new StyleBundle("~/bundles/bootstrap").Include(
                        "~/Scripts/bootstrap.js",
                        "~/Scripts/bootstrap.min.js"));

            bundles.Add(new StyleBundle("~/bundles/knockout").Include(
                        "~/Scripts/knockout-3.2.0.debug.js",
                        "~/Scripts/knockout-3.2.0.js",
                        "~/Scripts/knockout.mapping-latest.debug.js",
                        "~/Scripts/knockout.mapping-latest.js"));

Then I have this my shared layout to render the bundles, but I keep getting "IndexOutOfRangeException errors on these two lines:

@Scripts.Render("~/bundles/bootstrap")
@Scripts.Render("~/bundles/knockout")
AtlasBowler
  • 267
  • 1
  • 8
  • 18

1 Answers1

3

It was a stupid mistake. Those were supposed to be ScriptBundles but I used StyleBundles.

It works now.

AtlasBowler
  • 267
  • 1
  • 8
  • 18