2.0 bug? in Type.GetFields() ?

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?
 
L

Lloyd Dupont

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top