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);
More Related Contents:
- How do I get the path of the assembly the code is in?
- Set object property using reflection
- How to create a new object instance from a Type
- How do I use reflection to invoke a private method?
- How to Load an Assembly to AppDomain with all references recursively?
- How can I get all classes within a namespace?
- How to get a list of properties with a given attribute?
- How to determine if a type implements a specific generic interface type
- Purpose of Activator.CreateInstance with example?
- Mapping object to dictionary and vice versa
- Reflection – Getting the generic arguments from a System.Type instance
- Using Case/Switch and GetType to determine the object [duplicate]
- Use reflection to invoke an overridden base method
- What is the “cost” of .NET reflection? [duplicate]
- Get a generic method without using GetMethods
- How to check whether an object has certain method/property?
- GetProperties() to return all properties for an interface inheritance hierarchy
- Invoking methods with optional parameters through reflection
- Resolve Type from Class Name in a Different Assembly
- Check if a property exists in a class
- How to copy value from class X to class Y with the same property name in c#?
- How do I create a generic class from a string in C#? [duplicate]
- Get member to which attribute was applied from inside attribute constructor?
- How Can I add properties to a class on runtime in C#?
- Look if a method is called inside a method using reflection
- Can I get parameter names/values procedurally from the currently executing function?
- How can I protect my private funcs against reflection executing?
- IsAssignableFrom() returns false when it should return true
- Reflecting a private field from a base class
- Two Types not equal that should be