Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pieter Willaert 4 posts 84 karma points
    Sep 18, 2018 @ 19:44
    Pieter Willaert
    0

    Object Reference not set to an instance of an object

    Hello, so i'm making a site and stumble across this error. When debugging in vs shows that the value is present. However i still get an error 'Object Reference not set to an instance of an object'.

    So at the top of my template i declare this :

    ContentModels.HomePage page = Model.Content as ContentModels.HomePage;

    Then i want to fill in the rest of the template with the correct values. So i tested the first few and the site worked fine and it displayed everything correctly. But suddenly i get this. See pictures.... Error Debugging Error vb

    So in short: I don't understand what I did wrong...

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Sep 18, 2018 @ 21:20
    Alex Skrypnyk
    100

    Hi Pieter

    What ModelsBuilder mode are you using? Maybe models are outdates? Try to rebuild models. Check Models Builder documentation - https://our.umbraco.com/documentation/reference/templating/modelsbuilder/

    Alex

  • Pieter Willaert 4 posts 84 karma points
    Sep 18, 2018 @ 21:32
    Pieter Willaert
    0

    Thank you, I was using the LiveDll modelbuilder. I switched it to Dll and now it works again. Must have done something wrong somewhere... Thank for suggesting the modelbuilder.

Please Sign in or register to post replies

Write your reply to:

Draft