Over the years I kinda grew against closing questions as those very generic "canonical" Q&As with dozens of different causes, because of the sheer length and uselessness that accumulates over time in such canonicals.
I mean look at it. No really, look at it. Look at the first answer of the NullReferenceException canonical. It's a sixteen page long answer (at least on my 1080p laptop) that has been edited 57 times in 10 years, chock full of examples and edge cases nobody is ever going to read.
After it, there's a nineteen page long answer that basically states all the same things, except for VB.NET.
Seriously, look at it.

Try reading it as someone who just started programming, got an error, mustered the courage to post a question here and got their question dupehammered within seconds or minutes, probably even without a comment explaining why or how it's relevant.
It starts by using 50% of my screen estate with an example full of unreadable
inline
code
that ends with "... syke, nullable value types don't throw a NullReferenceException, this entire paragraph you just read is irrelevant". In fact, those two numbered blurb shows why developers do want to use null values, while the answer is meant to teach people how to prevent a NullReferenceException, so the reader most likely doesn't want to use a null value.
What follows are a simplification of the exception and some debugging hints, written by yours truly, and not edited in over six years, apart from adding
markup abuse (and irrelevant text).
All this Q&A does is show that collaborative editing doesn't work without strict editing guidelines, something Wikipedia figured out two decades ago. The last edit, which coincidendtally was made by you, OP, changed the correct term "null dereference" to "NullReferenceException" and made sure null
is marked as inline code frigging everywhere - that edit was not a good one.
Does that answer, after all these edits, help these people, some of the most recent victims of this canonical?
I don't even want to continue finding examples where it's a totally inappropriate duplicate. People, it is not the short and to the point canonical it once was, and there's new ways of throwing NREs emerging every other week, usually by a combination of factors that cannot easily be debugged, not even after reading seven pages of by far not exhaustive examples.
So yeah, no. Stop using this monstrosity as a duplicate target, and find, edit and use more specific duplicate targets that actually resemble the OP's problem whose question you're trying to close as fast as you can, just because they happened to ask something you saw once too often.
And, on-topic, definitely don't use it for an exception that is not a NullReferenceException, because in that case you're definitely "RTFM"-ing or "LMGTFY"-ing by saying "go learn to debug, bye". That makes you a jerk, and a lazy one at that.
ArgumentNullException
is not that common, mostly users are able to read msdn or again, they can't do this either yet, give them a hint pointing to msdn then, don't bother with the answer. Future reader will NOT benefit from this questions at all.ArgumentNullException
into theNullReferenceException
post, which presumably mostly means editing the title to include it and adding a note about it in the answer. Or post a short Q&A which mostly just says one of the arguments of something is null and refers to the NRE post for the possible causes of that. This assumes questions about the error are common enough for a canonical post. I wouldn't duplicate what's written in the NRE post into a separate Q&A. That would mean almost any change required on one needs to be applied to the other as well.