C
C#2y ago
Yume

❔ 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
SinFluxx
SinFluxx2y ago
Does the _TopLayout.cshtml file exist?
Yume
YumeOP2y ago
Yes they both do
SinFluxx
SinFluxx2y ago
and it's in the /Views/Shared folder?
Yume
YumeOP2y ago
yep
TheRanger
TheRanger2y ago
or maybe ur trying to access a null variable in this file, start debugging that file
Yume
YumeOP2y ago
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 😦
Accord
Accord2y ago
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.

Did you find this page helpful?