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?
Look at the following definition. Notice
Foois visible to anyone, and its public methodGetBaris also visible to anyone who can seeFoo:Here’s the definition of
Bar:Notice
Baris internal to the assembly, whereasFoois visible to all.Foocannot exposeBarto the outside world, so the compiler throws this exception.Another example would be:
Baris a private class ofFooand can only be visible to instances ofFoo.Foocannot expose this type to the outside world, so the compiler throws the same exception.Examples of refactoring:
Make the hidden type public
Encapsulation
Hide everything
Refactor it away