Search code examples
asp.net-mvcasp.net-mvc-5asp.net-bundling

In ASP.NET MVC 5 app, the bundled css is not reflecting the original css file


I have a css style sheet file which I have modified as per my style needs. But when the file is bundled using ASP.NET bundling, the changes I made are not reflected in the minified css file.

I have set,

BundleTable.EnableOptimizations = true;

in the BundleConfig.cs file and I can view the minified file in the source view. So no doubts in the file being minified.


Solution

  • The ASP.NET bundling process will pick existing minified files of the non minified files, if any relevent minified files are found in the same directory. So, check and remove any related minified files (minified files with the same name) from the directory (not just exclude from the project, remove the file completely from the directory). This will make ASP.NET bundling minify the file from scratch. So the new changes will reflect in the new minified file.