Inconsistent accessibility: field type 'world' is less accessible than field 'frmSplashScreen

前端 未结 4 1356
一向
一向 2020-12-15 17:26

I have this error called Inconsistent accessibility:

field type \'world\' is less accessible than field \'frmSplashScreen\'

In

相关标签:
4条回答
  • 2020-12-15 18:11

    also , I got such an error with public access modifier. The solution was to add {get;set;} getter and setter to properties

    0 讨论(0)
  • 2020-12-15 18:18

    Generally this happens because your field is private. You must change it to public:

    public world currentWorld;
    

    For more on this, take a look here: Restrictions on Using Accessibility Levels (C# Reference)

    0 讨论(0)
  • 2020-12-15 18:22

    This can also happen when you have not initialized your class "world" as public

    you should do :

    public class world
    

    Instead of :

    class world
    
    0 讨论(0)
  • 2020-12-15 18:28

    you can't use private access specifier in that statement

        Public class world
    

    will solve this problem

    0 讨论(0)
提交回复
热议问题