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....
So in short: I don't understand what I did wrong...
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.
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 :
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....
So in short: I don't understand what I did wrong...
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
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.
is working on a reply...