Yes, this is intentional and it's necessary for a number of aspects of .NET
to function properly.
Remember, things like private and protected are generally language specific
issues, so you could very well write a language that didn't use access
modifiers and didn't respect them in the framework or other .NET software.
On the other hand, I wouldn't recommend using it willy-nilly.
There have actually been times where I've used it to bypass what I would
consider bad design choices by MS, to get at functionality in the underlying
framework that I otherwise couldn't. But I would not expect that code to
work in future versions of .NET, so consider doing stuff like that to be
non-portable and generally unsafe.
Pete
"Picho" <SP********@telhai.ac.il> wrote in message
news:Os****************@TK2MSFTNGP15.phx.gbl...
Hi all,
Using reflection, I can invoke/call private methods of an object.
is this intended?
if yes, why? in what scenario (example would be good) should I be givven
the option to use something that was declared private (not public) and not
mine to use? seems to me this is somewhat malicious...
if not.... well....
Thanx,
Picho