Re: Medium Level Trust and Reflection

From: Shawn Farkas [MS] (
Date: 03/02/05

Date: Wed, 02 Mar 2005 00:43:49 GMT

You should need ReflectionPermission in order to Invoke a MethodInfo that
you have, regardless of the visibility of the method. A quick test I
slapped together shows this to be true on both v1.1 and the latest v2.0
builds. I'm curious as to Nicole's test ... Nicole can you let us know in
more detail what you were doing?

This posting is provided "AS IS" with no warranties, and confers no rights.

For the benefit of the community-at-large, all responses to this message
are best directed to the newsgroup/thread from which they originated.
> Reply-To: "Joe Kaplan \(MVP - ADSI\)"
> From: "Joe Kaplan \(MVP - ADSI\)"
> References: <Oy8Y4M1GFHA.2744@tk2msftngp13.phx.gbl>
> Subject: Re: Medium Level Trust and Reflection
> Date: Tue, 1 Mar 2005 12:59:58 -0600
> Lines: 29
> Organization: Accenture
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
> X-RFC2646: Format=Flowed; Response
> Message-ID: <uro1ZDpHFHA.1948@TK2MSFTNGP14.phx.gbl>
> Newsgroups:
> NNTP-Posting-Host:
> Path:
> Xref: TK2MSFTNGXA02.phx.gbl
> X-Tomcat-NG:
> I trust your analysis is correct since you actually bothered to test
> <g>
> Perhaps Shawn can fill us in on the apparent "incongruity" of the
> documentation.
> Shawn?
> Joe K.
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
> news:uuxVHCoHFHA.3484@TK2MSFTNGP12.phx.gbl...
> >I did test it, so I'm reasonably sure that it works that way on the
> >version of the .NET Framework that I happened to test it on. <g>
> >
> > Testing aside, it looks like you may have found a bit of a
> > error. The best source for information on the flavours of
> > ReflectionPermission is probably the documentation on the
> > ReflectionPermissionFlag enum. According to that source,
> > ReflectionPermission\TypeInformation and
> > are meant to allow use of non-public types and members, respectively.
> > course, any code that demands reflection permission may have its own
> > of bugs with respect to the permission set that is actually demanded,
> > these may not end up getting used as intended...
> >
> >
> >