Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inconsistent Accessibility error

Tags:

People also ask

How do you fix inconsistent accessibility in C#?

Solution 1 You can fix it by making the base class the same access level as the derived class, or restricting the derived class.

How do I fix cs0053?

The simplest fix for this issue is to add or remove the public access modifier to the class or interface. Because as per the above explanation, this issue will occur when two different access modifiers for class/interface and property. Then one of the access modifiers is less accessible than others.


I tried upgrading an ASP.Net application from Visual Studio 2005 to 2008, and I tried compiling just to verify that it would compile and I received this error.

Error   1   Inconsistent accessibility: property type 'Web.Properties.UITitleSettings' is less accessible than property 'Web.Ctrl.BasePanel.UISettings' \\projectLocation\Ctrl\BasePanel.cs 25  43  ProjectName

(I removed the class path before Web.Properties and Web.Ctrl, it normally contains it)

The piece of code its referencing is

public Properties.UITitleSettings UISettings
    {
        get
        {
            return _uiSettings;
        }
    }

I'm not quite sure what this error is attempting to say. Does the type need to be casted (invalid implicit cast between two incompatible types?) or is it a class override issue?