❔ ASP.NET MVC: Object reference not set to an instance of an object
I'm getting a confusing error in my view, hard to google. It was working before and I don't know what might've caused it. Anyone seen this before or know how I can troubleshoot? Even weirder is I got a different version of this same error a couple lines down with the code
@Html.Partial("~/Views/Shared/_Header.cshtml")
. I removed it and now get the pictured error, even though the Layout code should've been run first??7 Replies
Does the _TopLayout.cshtml file exist?
Yes they both do
and it's in the /Views/Shared folder?
yep
or maybe ur trying to access a null variable in this file, start debugging that file
Ok thanks I'll dig into it
wish the error would throw in the file if that is the case
no luck. besides, these files haven't changed and work on other pages 😦
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.