When I run my code from Visual Studio in release mode, and check the bundled style sheet, I can see my updates to the css files in that bundle. However when I publish the website to the server or my local machine, my changes in the style sheets have not come through. The bundled style sheet is still the old one.
I have tried an IIS reset, a clean build/rebuild, deleted all files from the IIS folder and re-published.
I am using LESS if that makes any difference.
My bundle config:
This can happen if you have a minified version of a css file in the same directory as your unminified file.
For example, if you have the following files:
in your directory, and you register the "bootstrap.css" file in your bundle, the optimizer will first attempt to use the "bootstrap.min.css" file during publish. If you only updated the "bootstrap.css" file and did not update the "bootstrap.min.css" file, you will get the old styles from "bootstrap.min.css". You can fix this problem by deleting the "bootstrap.min.css" file or by updating it.
This does not happen in a debug build because it does not pull the minified files if your compilation is set for debug using the following:
<system.web> <compilation debug="true" /> <!-- Lines removed for clarity. --> </system.web>
You can also overwrite the web.config setting by disabling the optimizations via:
BundleTable.EnableOptimizations = false;
This would go inside your BundleConfig.cs file.