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 make the Base class constructor internal-only, the error goes away. Since the class is abstract, maybe adding protected to the accessibility doesn't accomplish anything...
Still, I don't understand the error. MSDN defines 'protected internal' as
"Access is limited to the current assembly or types derived from the containing class"
How is the internal interface IFoo less accessible than an internal protected constructor?