C# Error CS0061 – Inconsistent accessibility: base interface is less accessible than interface

C# Compiler Error

CS0061 – Inconsistent accessibility: base interface ‘interface 1’ is less accessible than interface ‘interface 2’

Reason for the Error

This is similar to the error code CS0060 but is more related to the interfaces than classes.

For example, try compiling the below code snippet.

internal interface IEmployee
{
}

public interface IPartTimeEmployee : IEmployee
{

}

This will result with the compiler error CS0061 because you have an interface IEmployee which has access modifier internal and the interface IPartTimeEmployee is extending from it.

Error CS0061 Inconsistent accessibility: base interface ‘IEmployee’ is less accessible than interface ‘IPartTimeEmployee’

Solution

Ensure that the type that you are using for the base interface is public. You can set the access-modifier of the Employee interface to public to fix this error.

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

C# Compiler Error CS0442 – ‘Property’: abstract properties cannot have private accessors Reason for the Error You’ll get this error...
This is a really simple one . Below is a simple example of an enum called “Designation” defined with the...
This blog post explain the usage of the Checked Block in .NET and how you can use them in Visual...