Re: Type.GetProperty() does not work for private properties?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Martin,

The problem is, that Type.GetProperty() returns null if propertyName is the
name of a private property.
Shouldn't GetProperty() also return private properties when
BindingFlags.NonPublic is specified?

Yes, and it works fine here. The property isn't static, is it? Can you
post a complete application that will reproduce the problem?


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
.



Relevant Pages

  • Alleged Spin-Bowler, Murali, throws
    ... For the information of the more traditional readers of this newsgroup. ... Don't visit my blog, it is private property! ...
    (rec.sport.cricket)
  • Re: They impersonated policemen to rob.
    ... not just your private property. ... wipe yourself out means not to the newsgroup, ... Write a filter program to filter it out. ...
    (soc.culture.china)