2.0 bug? in Type.GetFields() ?

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

I have a type like that:

class Foo
{
int anInt;
object anObject;
}

I query its internal structure with
typeof(Foo).GetFields(BindingFlag.Instance | BindingFlag.NonPublic |
BindingFlag.FlattenHierarchy)

And I get an array with only: anObject.

in my real life example base type such as string, int, couble where not
returned.
but all the others where returned....

mmhh... :/

how do I get this field?
I'm using 2.0, that might be a bug with it, but I kind of doubt it as
serialization is working!
mmhh.. :/

any idea?
 
found it!
in fact FlattenHierachy doesn't seems to work with base types (int, double,
etc..), that's why!
 
Back
Top