C
C#12mo 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
SinFluxx12mo ago
Does the _TopLayout.cshtml file exist?
Yume
Yume12mo ago
Yes they both do
SinFluxx
SinFluxx12mo ago
and it's in the /Views/Shared folder?
Yume
Yume12mo ago
yep
TheRanger
TheRanger12mo ago
or maybe ur trying to access a null variable in this file, start debugging that file
Yume
Yume12mo 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
Accord12mo 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
More Posts