Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

enum property inconsistent accessibility

Tags:

c#

I am new at CSharp, and do not understand what is the problem.

public abstract class Player
{
protected Behaviour fBehaviour;
public Behaviour FBehaviour { get; set; }

the error says Error 6 Inconsistent accessibility: field type ... is less accessible than field ...

I've tried changing everything, but nothing worked.

like image 791
Orvel Avatar asked Apr 10 '26 00:04

Orvel


1 Answers

It means that class Behavior is not public, but Player is and is trying to expose it as public.

Change Behavior to be public.

like image 63
Axarydax Avatar answered Apr 11 '26 14:04

Axarydax



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!