Css and Js, IController exception

I am trying to create packages of JS and CSS files. The folder structure is as follows:

  • ~
    • Scenarios
      • A
      • IN
      • FROM
    • Content
      • CSS
        • ACSS
        • BCSS
        • CSS
      • IMG

I extracted some help from MVC Central and added this code to my project:

bundles.Add(new ScriptBundle("~/bundles/A/AAA").Include(
                    "~/Scripts/A/jquery-{version}.js");
bundles.Add(new ScriptBundle("~/bundles/B/BBB").Include(
                    "~/Scripts/A/jquery-{version}.js");
bundles.Add(new StyleBundle("~/Content/CSS/ACSS").Include("
                     ~/Content/CSS/ACSS/MyCss-*"));

But it returns exception 404:

System.Web.HttpException (0x80004005): Controller for paths '/ bundles / A / AAA' not found or does not implement IController.

Edit: I registered my Bundles in a file Global.asax. so at least I'm not making a schoolboy mistake.

BundleConfig.RegisterBundles(BundleTable.Bundles);

What have I done wrong to cause this error?

+4
source share
1 answer

, , System.Web.Optimization.PreApplicationStartCode.Start , MVC.

, Application_Start Global.asax.cs :

protected void Application_Start(object sender, EventArgs e)
{
    //other code startup code here

    System.Web.Optimization.PreApplicationStartCode.Start();
}

, System.Web.Optimization.BundleHandler ProcessRequest.

, ( ...), : http://beletsky.net/2012/04/new-in-aspnet-mvc4-bundling-and.html

+3

All Articles