Security Permissions

Hi,

How I can protect a non-public class members by means of System.Security.Permissions classes so that it was impossible to access through reflection

Thanks




Answer this question

Security Permissions

  • Sachit Kachraj

    There's no way to make it impossible too access low visibility members via reflection. You can make it slightly more difficult by verifying the call stack for outside callers (at least for members other than fields), but even this would not completely prevent access from a highly privileged caller. Also, there's really not much of anything that you can do with respect to protecting fields.
  • Scott Munro

    If someone has administrator privileges on the box, then this nothing you can do to prevent access.

  • Security Permissions