This is an old thread, but I have encountered a similar problem recently, and none of the above worked for me. Adding my solution as it may be useful to others.
As already mentioned, if a property of a property is private, it does not exist in the inherited class. For me it worked at the same level below using the DeclaringType PropertyInfo
Thus, the code for retrieving the property with the installer will look like this:
var propertyInfo = typeof(MyClass) .GetProperty("Components", BindingFlags.NonPublic | BindingFlags.Instance) .DeclaringType .GetProperty("Components", BindingFlags.NonPublic | BindingFlags.Instance);
In this case, PropertyInfo contains the value for SetMethod , so you can set the value using reflection.
Piotrwolkowski
source share