Let's say I have a class A that contains a class B which itself contains another class C. Something as follows
class A
{
B b;
}
class B
{
C c;
}
I have a method that takes instance of class A as parameter.
private void MyMethod(A a)
{
}
Let's say this class A instance passed in this method contains some data that is causing some issue and I need to figure that out. Will I be able to inspect value of A instance and any of its children if I capture IntelliTrace log?
By default it is not possible because of two limitations of IntelliTrace i.e.:
IntelliTrace records/captures only values of fields/properties that that are primitive data types.
IntelliTrace does not analyse the object graph.
Let's extend your example:
In this case in IntelliTrace log you will only find a value of
Prop1because it is an int. In the case ofProp2you will only see if it is set or not.As the workaround you can try to define a custom diagnostic event. However, it is not so easy. You can start by reading Custom TraceSource and debugging using IntelliTrace and VS 2010 : Customize IntelliTrace events. See also this and this question.