Question about Enumerations

  • Thread starter Thread starter Beringer
  • Start date Start date
B

Beringer

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
 
Beringer said:
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.
 
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
 
Back
Top