Scripts.Render using outdated javascript file

情到浓时终转凉″ 提交于 2019-11-28 12:49:25

This is likely a caching issue. When using Bundling and Minification in debug mode (when <compilation debug="true" /> is set in your web.config), bundling/minification is disabled.

You can override this and force bundling and minification by adding BundleTable.EnableOptimizations = true;. This will make it act like it will in your production environment, where everything is bundled and minified, and the script reference includes that versioning parameter (like you gave) that will force the browser to reload your scripts when anything changes.

public class BundleConfig
{
    public static void RegisterBundles(BundleCollection bundles)
    {
        //all your bundle code
        BundleTable.EnableOptimizations = true;
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!