I have an interface and an abstract base class defined in the same assembly:
IFoo.cs:
internal interface IFoo { ... }
Base.cs:
public abstract class Base { internal protected Base(IFoo foo) { ... } }
This generates the following compiler error:
CS0051: Inconsistent accessibility: parameter type 'IFoo' is less accessible than method 'Base.Base(IFoo)'
If I create the constructor of the base class for internal use only, the error will disappear. Since the class is abstract, an access-protected addition is possible, does nothing ...
However, I do not understand the error. MSDN defines "protected internal" as
"Access is limited to the current assembly or types retrieved from the containing class"
How is the internal IFoo interface less accessible than the internal secure constructor?
source share