Results 1 to 3 of 3

Thread: [RESOLVED] Inconsistent Accessibility: base class WorkItem is less accessible than class...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Resolved [RESOLVED] Inconsistent Accessibility: base class WorkItem is less accessible than class...

    Hello, I'm following a tutorial at Inheritance (C# Programming Guide) | Microsoft Docs and I'm getting this error:

    Inconsistent Accessibility: base class WorkItem is less accessible than class ChangeRequest

    What's going on here? I've come accross with this before on that site. Here's a part of the code:

    VB.NET Code:
    1. namespace Business
    2. {
    3.     // ChangeRequest derives from WorkItem and adds an item (originalItemID)
    4.     // and two constructors
    5.     public class ChangeRequest : WorkItem
    6.     {
    7.         protected int originalItemID { get; set; }
    8.         ...

  2. #2
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Inconsistent Accessibility: base class WorkItem is less accessible than class...

    The line of code
    Code:
     public class ChangeRequest : WorkItem
    is declaring a public class called ChangeRequest that inherits WorkItem. If you want to make ChangeRequest public then WorkItem would also need to be public, I would check the WorkItem class and see if it is public or not.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Re: Inconsistent Accessibility: base class WorkItem is less accessible than class...

    Oh I forgot to add "public" in the other class. Thanks a lot.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width