Let's say I am a initializing a new object at once that has many properties. One of them causes a null reference exception, but when you use the debugger it passes through the entire code initialization block at once. Is there any easy way to find which property caused the error. Note that the object properties maybe many types so some of the types are allowed to be null.
ex object initalization
var obj = new Obj{
prop1 = x,
prop2 = y,
prop3 = f,
prop4 = r,
prop5 = h,
prop6 = k,
prop7 = w,
prop8 = l,
prop8 = m,
prop9 = e,
prop10 = a
};
One of these properties caused the null reference exception but you don't know which and the debugger passed through the entire block at once. Is there a method to identify this with visual studio?