I have been a .NET developer for over a decade, so this is a shameful question that I never knew about. I get this - if the argument is null, I can raise an ArgumentNullException. A NullReferenceException will be thrown if I try to dereference a null value.
But what if I have code like the following:
var someVitalObject = someServiceReference.GetVitalObject(); if (someVitalObject == null) { throw new IDontKnowWhatException();
Now this is not necessarily a problem with the service for which the exception should have been sent earlier.
c # exception exception-handling
vargonian
source share