- VBForums
- .NET and More
- C#
- [RESOLVED] Inconsistent Accessibility: base class WorkItem is less accessible than class...
-
Aug 17th, 2017, 01:01 PM
#1
Thread Starter
Addicted Member
[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:
namespace Business
{
// ChangeRequest derives from WorkItem and adds an item (originalItemID)
// and two constructors
public class ChangeRequest : WorkItem
{
protected int originalItemID { get; set; }
...
-
Aug 17th, 2017, 01:03 PM
#2
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.
-
Aug 17th, 2017, 01:03 PM
#3
Thread Starter
Addicted Member
Re: Inconsistent Accessibility: base class WorkItem is less accessible than class...
Oh I forgot to add "public" in the other class. Thanks a lot.
- VBForums
- .NET and More
- C#
- [RESOLVED] Inconsistent Accessibility: base class WorkItem is less accessible than class...
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|