I was doing some coding in c#. I had one class but decided to split it up so I could reuse some of the functionality later. So I made a simple shell and started moving pieces into the parent class.
On my first compile I got this message: Inconsistent accessibility: base class is less accessible than class
I am a little rusty with my C# and classes, but it turns out I left off the public keyword on the new class. Adding public fixed that compile error.
I had this same error, arrrg, that was annoying, i sat there for awhile looking at my controller and DAL and couldnt figure it out. I looked up the error and got your site, thanks for the help :)
ReplyDeleteSame here...
ReplyDeleteGot the error, started Google, found you within seconds and problem solved XD
Thanks!
And now I see some other interesting stuff on your site, so lets have a look at that :D
Same deal as previous posters. Thanks for the help.
ReplyDeleteAh, thanks, me too!
ReplyDeleteThanks. I just assumed classes were public by default.
ReplyDeleteassesSaved++;
I fell into the same trap, thanks for a rapid solution!
ReplyDeleteperfect! thanks for the help!
ReplyDeleteI just ran into this same problem while working on a lab in the 70-528 MCTS book. When you first bring up the code-behind the first class does not have the public infront of it. Of course, in Visual Studio, the default is Public. I added the public in front of the class in question and boom! It worked.
ReplyDeleteYou trully saved me!!! Thanks!!
ReplyDeleteI'm such a failboat, thanks for the great help
ReplyDeleteI love you man :D
ReplyDeleteJust saved me a really big headache
I had this error too but the class and instantiation of the class were both declared as public. However, the instantiation was using an enumber as one of the parameters and the enumbers were not declared as public. Made 'em public - jobs a good 'un. Just something else to look out for!
ReplyDeletei had the same error, thanks for the post!
ReplyDeleteSame error
ReplyDeleteTripped across this five years later. Have the same problem, except that in my case, I'm calling an object class from a class that I'm using to build a list, both are public all the way down and I'm _still_ getting the error.
ReplyDeleteHunting for the solution.....
Shirley Hicks
thanx buddie you just saved me :)
ReplyDelete