Bundling scripts are not getting rendered

前端 未结 4 1136
梦谈多话
梦谈多话 2020-12-04 02:08

I am having a problem with script bundling and minification with ASP .NET I have tried all popular solution found on internet but still having the same problem.

My <

4条回答
  •  误落风尘
    2020-12-04 02:35

    You can't give your bundle a name that is also the name of an existing directory. Rename the bundle or add a /js to make it work correctly:

    bundles.Add(new ScriptBundle("~/Scripts/js").IncludeDirectory("~/Scripts", "*.js").IncludeDirectory("~/Scripts/kendoui", "*.js"));
    

    and

    @Scripts.Render("~/Scripts/js")
    

    Any other name that doesn't exist would work as well, e.g.

     bundles.Add(new ScriptBundle("~/ScriptMonkey").IncludeDirectory("~/Scripts", "*.js").IncludeDirectory("~/Scripts/kendoui", "*.js"));
    

    ...assuming you don't have /ScriptMonkey directory.

提交回复
热议问题