Getting reflection permissions with ReflectionPermissionAttribute
-
Hey all. I am having a bit of trouble with ReflectionPermissions. I have some code that uses reflection to access properties of classes in a different assembly (also mine). The issue is it only gets the private fields from the top-most object, it does not see the private fields from any of the base objects. I have been trying different things with
ReflectionPermissionAttribute
s with no luck. I think I don't understand how to use it correctly. Anyone got any ideas? Do I have to have the calling code set something or the objects with the private fields? Or the assembly in which they live? On the calling class I have tried things like[ReflectionPermission(SecurityAction.Assert, Flags = ReflectionPermissionFlag.AllFlags, MemberAccess = true, Unrestricted = true)]
with no luck. Any help on this would be great. Thank you in advance. Luke