0

So I recently update from bootstrap 2 to bootstrap 4. I then changed the syntax, grids and such. The website was running/building fine in debug, however, when it comes to release, it won't work. It can build without errors, but when I run it, it seems like the site has the new syntax and classes (the code running is the one i changed) but bootstrap is still at v.2. I checked multiple times, there are no bootstrap 2 files left, nor any cdn references. I can see it still is running bootstrap 2 by changing classes from col-12 to, say span12. It works fine in debug, but not in release. Any clue why ?

Also, the site is running Asp.NET Core MVC Razor.

  • Have you cleared your browser cache? And how are you referencing bootstrap? Did you add it to your project manually, or are you using a package manager? – tattarrattat Jul 17 '18 at 15:22
  • I did clear cache. I'm referencing it using bundles, no package manager. – Etienne Poulin Jul 17 '18 at 15:27
  • Maybe an issue with the bundles not getting rebuilt in Release mode? This could be helpful: [asp.net bundling](https://stackoverflow.com/questions/12158933/asp-net-bundling-bundle-not-updating-after-included-file-has-changed-returns) – tattarrattat Jul 17 '18 at 15:40
  • I found that enabling the DEBUG constant while in release mode makes it work... However, I only have 2 #if DEBUG, which I tried removing/changing, but that didn't fix anything... I'll continue trying to figure out the problem... – Etienne Poulin Jul 17 '18 at 15:54
  • Can you share the code of Index.cshtml or Layout.cshtml code where you are referencing the css bundles. – Mohsin Mehmood Jul 17 '18 at 16:32

1 Answers1

1

I think you might have a bundle-ing configuration issue. Please verify your bundle configuration (App_Start\BundleConfig.cs) and the web.config settings and pertinent web.config transform. You can find documentation on how to configure your bundles here : Bundling and Minification (assuming you're not using ASP.NET Core)

For ASP.NET Core it a bit more complicated because you can have multiple ways of doing the budleing. Documentation for it can be found here: Bundle and minifiy static assets in ASP.NET Core.

However, I think that is pretty probable that the production version of your app is still targeting the old Bootstrap version because of the bundle-ing configuration

Ionut Ungureanu
  • 1,020
  • 1
  • 13
  • 16