When I use enumerations I frequently get compilation errors that state:
"Inconsistant Accessibility: <something> is less accessible than <something>

I have been getting around this through casting but really don't like that
since it defeats enumerations.

When I define an enumeration, I place the definition within my namespace. I
have even tried placing the enumerations in a seperate .cs file called
enumerations and this doesn't help either.

Thanks in advance,
Eric

Re: Question about Enumerations by Jon

Jon
Wed Sep 08 01:04:51 CDT 2004

Beringer <borden_eric@invalid.com> wrote:
> When I use enumerations I frequently get compilation errors that state:
> "Inconsistant Accessibility: <something> is less accessible than <something>
>
> I have been getting around this through casting but really don't like that
> since it defeats enumerations.
>
> When I define an enumeration, I place the definition within my namespace. I
> have even tried placing the enumerations in a seperate .cs file called
> enumerations and this doesn't help either.

Just make the enumeration public. The problem (I guess - if this is
wrong, please post the code) is that you're declaring a public method,
but its return type isn't public.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: Question about Enumerations by Beringer

Beringer
Thu Sep 09 09:56:09 CDT 2004

I had tried making the enumeration public in the past and that didn't work
(infact it caused a completely different error message). I thought I would
try again now that I placed the enums in a separate enumerations.cs file and
I did not get a compiler error after setting them to public enums.

Thanks for the help.
Eric

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1ba8b15b2cb21cff98b36b@msnews.microsoft.com...
> Beringer <borden_eric@invalid.com> wrote:
> > When I use enumerations I frequently get compilation errors that state:
> > "Inconsistant Accessibility: <something> is less accessible than
<something>
> >
> > I have been getting around this through casting but really don't like
that
> > since it defeats enumerations.
> >
> > When I define an enumeration, I place the definition within my
namespace. I
> > have even tried placing the enumerations in a seperate .cs file called
> > enumerations and this doesn't help either.
>
> Just make the enumeration public. The problem (I guess - if this is
> wrong, please post the code) is that you're declaring a public method,
> but its return type isn't public.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too