Re: SecurityException "Request Failed"

From: Nicole Calinoiu (nicolec_at_somewhere.net)
Date: 07/27/04


Date: Tue, 27 Jul 2004 13:51:24 -0400

Unfortunately, I can reproduce the problem just fine, and it definitely runs
counter to the available documentation on the permissions that are supposed
to be required for this sort of invocation via reflection. I'll try to play
with it a bit more to see if I can narrow down the problem a bit. However,
in case it's not possible to make the problem without unrestricted
permissions, perhaps it might be best if you could describe what exactly it
is you are trying to do. Maybe someone can suggest an alternative that
wouldn't require reflection at all...

"VJ" <anonymous@discussions.microsoft.com> wrote in message
news:493201c4735d$475349d0$a501280a@phx.gbl...
> Yes, and yes :(
>
>>-----Original Message-----
>>Do either or both of the following scenarios work?
>>
>>1. Call c() from b() without using reflection.
>>2. Call c() from b() using reflection, but with c()
> being launched directly
>>(not via reflection) from other fully trusted code
> instead of from a().
>>
>>
>>
>>"VJ" <anonymous@discussions.microsoft.com> wrote in
> message
>>news:44b901c47336$543898c0$a401280a@phx.gbl...
>>> The calling assembly does have full trust. But the call
> is
>>> part of a stack frame that has the partially trusted
>>> assembly higher up in the call sequence . In other
> words,
>>> the method that is asserting the permissions is being
>>> called by the partially trusted assembly, and this
> method
>>> in turn is trying to invoke a method of another class in
>>> the partially trusted assembly.
>>>
>>> eg:
>>> a() calls b() calls c()
>>>
>>> Both a() and c() are in the partially trusted assembly.
>>> b() is the method that is asserting the permissions.
>>>
>>> The type and methods being called are all public.
>>>
>>> VJ
>>>
>>>>-----Original Message-----
>>>>"VJ" <anonymous@discussions.microsoft.com> wrote in
>>> message
>>>>news:3c0d01c472b9$2a619150$a601280a@phx.gbl...
>>>>> The method that is making the call has Unrestricted
>>>>> reflection permission asserted. Any idea why this
> fails.
>>>>
>>>>If the calling assembly has full trust, there should be
>>> no need to assert
>>>>reflection permissions. The most likely reason for the
>>> failure is that the
>>>>callee requires some permission that is not
> automatically
>>> granted to fully
>>>>trusted code. Did you author the callee code? What's
>>> the accessibility
>>>>level on the classes and methods you're attempting to
>>> call? Can you call
>>>>them successfully without using reflection?
>>>>
>>>>
>>>>.
>>>>
>>
>>
>>.
>>



Relevant Pages

  • Re: SecurityException "Request Failed"
    ... > Thanks for taking the time to reproduce the problem. ... > assert full permissions, the call goes through. ... > PTA in certain scenarios. ... >>wouldn't require reflection at all... ...
    (microsoft.public.dotnet.security)
  • Re: SecurityException "Request Failed"
    ... What I found was that the documented permissions for the reflection ... necessary to invoke a strongly named assembly in this way, ...
    (microsoft.public.dotnet.security)
  • Re: SecurityException "Request Failed"
    ... Call cfrom bwithout using reflection. ... from other fully trusted code instead of from a. ... > bis the method that is asserting the permissions. ...
    (microsoft.public.dotnet.security)
  • Re: SecurityException "Request Failed"
    ... Call cfrom bwithout using reflection. ... >from other fully trusted code ... >> bis the method that is asserting the permissions. ...
    (microsoft.public.dotnet.security)
  • permissions
    ... flags Execution, Reflection, Unmanaged Code, Control ... requestminimum and are granted the same set of permissions. ...
    (microsoft.public.dotnet.security)