3

I have the requirement to call an internal method of a 3rd party object (I cannot make it public for example). I can do that via reflection. Unfortunately this does not work in ASP.NET Medium trust due to insufficient rights:

<IPermission class="ReflectionPermission" version="1" Flags="RestrictedMemberAccess"/></PermissionSet>

Is there any way I can internal methods in this case? I've heard that LINQ expressions can be used to call private/internal methods. Would expression methods somehow override the ReflectionPermission?

Atanas Korchev
  • 30,562
  • 8
  • 59
  • 93

1 Answers1

3

I don't see a way to call it. The .NET security/trust model is designed to prevent exactly this sort of thing. If you could somehow circumvent it, you would have to file a security bug with Microsoft which would then (hopefully) be fixed and make your solution useless again ;-)

Can't you negotiate a higher trust level with the deployer/operator of your solution?

TToni
  • 9,145
  • 1
  • 28
  • 42
  • I ended up with the same conclusion. After all that's what code security is for :) I should find some other way to implement the requested feature. – Atanas Korchev Nov 05 '08 at 14:24