C
C#16mo 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
SinFluxx16mo ago
Does the _TopLayout.cshtml file exist?
Yume
YumeOP16mo ago
Yes they both do
SinFluxx
SinFluxx16mo ago
and it's in the /Views/Shared folder?
Yume
YumeOP16mo ago
yep
TheRanger
TheRanger16mo ago
or maybe ur trying to access a null variable in this file, start debugging that file
Yume
YumeOP16mo 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
Accord16mo 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.
Want results from more Discord servers?
Add your server