Re: Medium Level Trust and Reflection
From: Shawn Farkas [MS] (shawnfa_at_online.microsoft.com)
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.email@example.com>
> 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: microsoft.public.dotnet.security
> NNTP-Posting-Host: nbrds1495.accenture.com 184.108.40.206
> Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.security:9290
> X-Tomcat-NG: microsoft.public.dotnet.security
> I trust your analysis is correct since you actually bothered to test
> Perhaps Shawn can fill us in on the apparent "incongruity" of the
> Joe K.
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
> >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...