The reason, one of which is that the access level of the return parameter is less than the access level of the function, that is, when you define a method that returns a parameter, if the access level of the returned parameter is lower than the access level of the method, this error is understandable, if the returned parameter cannot be accessed, The returned method of the definition is also incorrect. (When you use a custom type in a Field/property/method with a more accessible (for example, public), this problem occurs when the type is less accessible (for example, protected/private))
Then: Each type referenced in the formal parameter list of the return type and method must have at least the same accessibility as the method itself
For example:
public class ClassA
{
Private Class SUBCLASSB
{ ... }
Public SUBCLASSB INSTANCEOFB;
}
In this case, there is an error of access inconsistency, when others use ClassA, INSTANCEOFB field because it is public, so it should be available, but its type, SUBCLASSB, but not open, causing conflict.
Workaround: Add public before the type you define to increase its access
C # Accessibility Consistency inconsistencies