tags:

views:

40

answers:

1

When I call GetProperties() on a type, the properties are ordered as they are written in the source code. This is very handy but my question is, if this is a guaranteed behavior or may this change depending on the runtime version and the environment. Does anyone know something about that?

+5  A: 

No, you can't assume the order will stay the same.

Quote from the doc:

The GetProperties method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies.

ho1