The Stacktrace of an exception i’m getting is:
/* snip */
at SomeSystemMethod()
at Namespace.Adapters.ListAdapterBase`1.GetObjects(String where)
at Namespace.Processes.MyProcess.Run()
/* snip */
This it seems that this is missing something after the second line, because ListAdapterBase is abstract and the method GetObjects is not called directly, but by another method of the child class:
public class ActualStateList : ListAdapterBase<ActualState>
{
/* snip */
public List<ActualState> GetByUserId(int userId)
{
return GetObjects(string.Format(
WHERECLAUSE_BYUSERID, userId));
}
/* snip */
}
So my first question is, how can it be, that there is no call of ActualStateList.GetByUserId() or another child class or method in the Stacktrace?
And secondly: the Run() method uses 4 child classes of ListAdapterBase, can I somehow find out, in which one the exception happened? Does the number behind ListAdapterBase somehow lead to precisely one of the child classes?
First question: Most likely
GetByUserIdis inlined in your Release build, that’s why it isn’t missing from the stack trace. Using the Debug build should show that method.Second question: From the StackTrace you are getting, you can’t infer which child class has been used. The number (
`1) is part of the class name ofListAdapterBaseand simply states that this class has one generic argument.One thought however: As the JIT is able to inline
GetByUserIdyou know certain things:virtualmethods aren’t inlined.GetObjectsare candidates for the specific child class usedGetObjectsis called in a simple method are candidates.These points might help you find the specific child class.
Adding a pdb file could help even more as it would show the line number in the
Runmethod that threw the exception. Adding pdb files is possible for Release builds, too.