There are five access modifiers in .Net
- protected internal
While the first four are pretty straight forward, developers get confused with the protected internal. Many developers think members marked as protected internal may be accessed only by a descendant class that’s contained in the same assembly as its base class. However the key thing to note is protected internal is a union of protected and internal in terms of providing access but not restricting. This implies
- Inherited types, even though they belong to a different assembly, have access to the protected internal members, and,
- Types that reside in the same assembly, even if they are not derived from the type, also have access to the protected internal members.
protected internal means protected or internal, which is selected by including both a protected and an internal modifier in the member declaration.