Prev: Why is my GetFields(BindingFlags.Instance | BindingFlags.Public) not working? (Sample working code included)
Next: AssemblyLoadEvent unexpected behaviour
From: Adam Clauss on 11 Jun 2010 12:12 On 6/11/2010 8:52 AM, sloan wrote > FieldInfo[] publicFieldInfos = t.GetFields(BindingFlags.Instance | > BindingFlags.Public); > > is returning nothing. > > > public abstract class MySuperType > > { > > public string STString > > { > > get; > > set; > > } > > public abstract string MyAbstractString {get;set;} > > } > > You are confusing fields and properties. You are retrieving public fields, but your class only has public properties. -Adam
From: Arne Vajhøj on 11 Jun 2010 19:43
On 11-06-2010 12:45, sloan wrote: > I forgot these newsgroups are being abandoned. > > The answer is "Use .GetProperties" instead. > > Someone at stackoverflow answered it for me. Well - you got an answer here too, so .... Arne |