I am curious about a very interesting thing, can give my query by a senario. Supposed I have written this code in my test method
[TestMethod]
Public void test method()
{
String userId = null;
Int lenght = userId.length;
}
In visual studio 2017 (as I am using this only)
It will throw nullreference exception through a pop-up which will say "userId was null".
As I have not handled through try and catch purposely.
Now I am curious about it that where did it get the parameter name ("userId") which was null... And if anyone knows about it please let me know if I can get the parameter name which was null in my catch block As in catch(Exception ex){ex.how_can_i_get_null_parameter}
. True help will be much appreciated may be a perfect answer can get a treat from me... For more details I will also attach screen shot of the pop-up as soon as I reach my work place.