Search code examples
.netreflectionfieldinternalaccount-management

How to set a base class internal field


Im extending a class (DirectoryServices.AccountManagement.Principal) and I need to assign a value to a field in the base class but its marked internal. Can I use reflection to set the value? How would that be done?

I found this:

base.GetType().GetProperty("unpersisted").SetValue(??, false);

But im not quite sure how to give it the base Principal object

Any guidance is much appreciated.


Solution

  • use this for ??