Bundling with MVC4 not working after I publish to azure

前端 未结 9 2197
闹比i
闹比i 2021-02-08 14:52

Hi I am trying to bundle my scripts for my application. My debug is working and if I publish with the Web.debug every thing works fine. But when I publish with the Web.releas my

9条回答
  •  深忆病人
    2021-02-08 15:15

    In my case, the virtual path of my bundle contains the . character. Something like :

    bundles.Add(new ScriptBundle("~/bundles/jquery.loadTemplate").Include(
                "~/Scripts/jquery.loadTemplate/*.js");
    

    I changed the dots by hyphens :

    bundles.Add(new ScriptBundle("~/bundles/jquery-loadTemplate").Include(
                "~/Scripts/jquery-loadTemplate/*.js");
    

    And everything works like a charm.

    I'm still not sure why it worked on my local machine but not on Azure...

提交回复
热议问题