Using GetProperties() with BindingFlags.DeclaredOnly in .NET Reflection

If you specify any BindingFlags, then you need to specify explicitly what properties you want to get. For example:

sometype.GetProperties (BindingFlags.DeclaredOnly | 
                        BindingFlags.Public | 
                        BindingFlags.Instance);

Leave a Comment