After updating the bootstrap this error appears when I try to run a view why? The object reference has not been defined as an instance of an object.

GILBERTO GEOFRAGAS 6 Reputation points


A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
736 questions
No comments
1 vote

4 answers

Sort by: Most helpful
  1. Michael Taylor 41,191 Reputation points

    You're using server side bundling. That means you have a BundleConfig.cs or similar file in your code where the bundles are defined. If you look in that file then it'll have a bundle defined for Bootstrap. Often when using server side bundling the code references the JS files and those files are contained in a versioned-path. If you updated bootstrap then you need to ensure you also updated the bundle configuration to use the new path otherwise you'll get runtime errors.

    1 person found this answer helpful.
    No comments

  2. Yijing Sun-MSFT 7,026 Reputation points

    I think,you need to check your bootstrap.js in BundleConfig.cs inside App_Start folder. Just like this:

                bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(  

    Best regards,
    Yijing Sun

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    No comments

  3. Prince Mathew 36 Reputation points

    Bootstrap v5 has no dependency on Jquery anymore so, I think including jquery and bootstrap.js in the same bundle object causes this issue. Check this URL:

    1 person found this answer helpful.
    No comments

  4. Prince Mathew 36 Reputation points

    If this issue is not resolved yet you can use the traditional way of approach, like in the image.


    1 person found this answer helpful.
    No comments