I'm trying to use the VS extensibility API but debugger support for looking at property values is poor, so I'm working on writing code to programmatically get object properties so I can explore the API at runtime to try and work out how to do things with it.
However I've noticed something strange: when calling typeof(VSLangProj.Reference).GetProperties() I only get back those properties that I've made use of in the source code.
eg:
1)
PropertyInfo[] props = typeof(Reference).GetProperties();int len = props.Length;
in this case, len == 0 - Reference has no properties.
2)
PropertyInfo[] props = typeof(Reference).GetProperties();int len = props.Length;
if (false)
{
Reference r;
int bn = r.BuildNumber;
}
in this case, len == 1. Reference now has one property.
Is there a way to 'populate' types with their type info so reflection works properly?