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.

5
  • 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? Commented Jul 17, 2018 at 15:22
  • I did clear cache. I'm referencing it using bundles, no package manager. Commented Jul 17, 2018 at 15:27
  • Maybe an issue with the bundles not getting rebuilt in Release mode? This could be helpful: asp.net bundling Commented Jul 17, 2018 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... Commented Jul 17, 2018 at 15:54
  • Can you share the code of Index.cshtml or Layout.cshtml code where you are referencing the css bundles. Commented Jul 17, 2018 at 16:32

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

3 Comments

I'm sorry for the confusion, but I am using .net Core. I edited the main post.
I've added the link for the ASP.NET Core bundleing documentation
It ended up working... As the site is pretty big and I didn't write it entirely myself, I wasn't aware but there was something pulling css from the live server instead of local.. Anyway, thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.