Re: Error: More than one protection modifier

Peter Ritchie <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <LISTSERV%[email protected]>
You're getting a CS0107 error "More than one protection modifier"?

Can you post the classes in question and point out the exact line you've
having the problem?  You're supposed to get this error if you define a
member with more than one protection modifier.  For example, the following
is bad:

public protected void Method(){}

On Fri, 8 Sep 2006 14:00:55 -0400, Peter Osucha
<[email protected]> wrote:

>I have two abstract classes in a project (absA and absB).  I have two
>derived classes from absA (absADerived1, absADerived2) and two from absB
>(absBDerived1, absBDerived2).
>
>In a class that uses objects of all 4 derived types, I have two methods;
the
>first (methA) takes an object of type absA and the second (methB) of type
>absB.
>
>When I want to call methA, I do so with something like...
>
>absADerived1 = new absADerived1();
>methA( (absA) absADerived1);
>
>This 'cast' seems to work fine.
>
>However, when I am trying to do the same thing with methB, ie...
>
>absBDerived1 = new absBDerived1();
>methB( (absB) absBDerived1);
>
>I am getting the error shown in the subject of this email in class absB
(on
>a constructor if that helps at all).
>
>the abstract classes absA and absB are virtually identical and there is
not
>more than one protection modifier.  I figure the real error is something
>else but I can't anything in MSDN on it.  Anyone know what might cause
this
>problem?
>
>Peter
>
>===================================
>This list is hosted by DevelopMentor®  http://www.develop.com
>
>View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.