Reputation: 4273
Scope of the protected internal
is same assembly, or by any derived class in another assembly.Then Why protected internal class cannot derive?
Sample code:
protected internal class AbsClass
{
int m = 50;
public int am = 5;
public void nonAbsfn()
{
Console.WriteLine(m + am);
}
}
class TestAbstract : AbsClass
{
}
Upvotes: 0
Views: 188
Reputation: 174289
A class can only be protected internal
if it is an inner class.
Otherwise, a class can only be public
or internal
.
To fix your compilation error, make the class either public
or internal
. The error you are getting has nothing to do with the derived class TestAbstract
.
Upvotes: 5
Reputation: 13495
According to the MSDN documentation:
The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.
So you should be able to do it. Can you post some of your code?
Upvotes: 0