Why does ResolveBundleUrl not work for custom folders? (MVC Beta 4)

前端 未结 2 1780
你的背包
你的背包 2020-12-15 18:27

From a brand-new ASP.NET MVC 4 Beta Web Application, I\'m re-arranging my folders to match Rob Conery\'s VidPub.Web example

Specifically, this means that the final d

2条回答
  •  感动是毒
    2020-12-15 19:10

    It appears you have to register your own bundle when using non-default directories. I added the following to Application_Start and it fixed the problem

    var bundle = new Bundle("~/Public/stylesheets/css", new CssMinify());
    bundle.AddDirectory("~/Public/stylesheets", "*.css", true);
    BundleTable.Bundles.Add(bundle);
    
    bundle = new Bundle("~/Public/javascripts/js", new JsMinify());
    bundle.AddDirectory("~/Public/javascripts", "*.js", true);
    BundleTable.Bundles.Add(bundle);
    

提交回复
热议问题