How to force BundleCollection to flush cached script bundles in MVC4

前端 未结 6 1327
梦谈多话
梦谈多话 2020-11-29 19:28

... or how I learned to stop worrying and just write code against completely undocumented APIs from Microsoft. Is there any actual documentation of the official

6条回答
  •  有刺的猬
    2020-11-29 19:50

    Have you tried deriving from (StyleBundle or ScriptBundle), adding no inclusions in your constructor and then overriding

    public override IEnumerable EnumerateFiles(BundleContext context)
    

    I do this for dynamic style sheets and EnumerateFiles gets called on every request. It's probably not the greatest solution but it works.

提交回复
热议问题