Re: Medium Level Trust and Reflection

From: Shawn Farkas [MS] (shawnfa_at_online.microsoft.com)
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?

-Shawn
http://blogs.msdn.com/shawnfa
--
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Note:
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\)"
<joseph.e.kaplan@removethis.accenture.com>
> From: "Joe Kaplan \(MVP - ADSI\)"
<joseph.e.kaplan@removethis.accenture.com>
> References: <Oy8Y4M1GFHA.2744@tk2msftngp13.phx.gbl>
<u3y8$I4GFHA.3352@TK2MSFTNGP10.phx.gbl>
<#1XfeZ4GFHA.3088@tk2msftngp13.phx.gbl>
<#zmyks4GFHA.576@TK2MSFTNGP15.phx.gbl>
<#VfQqN5GFHA.3272@TK2MSFTNGP10.phx.gbl>
<#vGgt25GFHA.2860@TK2MSFTNGP12.phx.gbl>
<F1BGzV6GFHA.2164@TK2MSFTNGXA02.phx.gbl>
<u9tkK$9GFHA.2736@TK2MSFTNGP09.phx.gbl>
<ecQ21ABHFHA.472@TK2MSFTNGP12.phx.gbl>
<e#EMOsXHFHA.3352@TK2MSFTNGP10.phx.gbl>
<O6HowBmHFHA.4060@TK2MSFTNGP14.phx.gbl>
<ucdiXWnHFHA.2852@TK2MSFTNGP12.phx.gbl>
<uuxVHCoHFHA.3484@TK2MSFTNGP12.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: microsoft.public.dotnet.security
> NNTP-Posting-Host: nbrds1495.accenture.com 170.252.248.205
> Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP1
4.phx.gbl
> 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
this.
> <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
exact
> >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
documentation
> > 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
ReflectionPermission\MemberAccess
> > are meant to allow use of non-public types and members, respectively.
Of
> > course, any code that demands reflection permission may have its own
set
> > of bugs with respect to the permission set that is actually demanded,
so
> > these may not end up getting used as intended...
> >
> >
> >
>
>
>