I want to make a type that can be inherited from by types in the same assembly, but cannot be inherited from outside of the assembly. I do want the type to be visible outside of the assembly.
Is this possible?
I want to make a type that can be inherited from by types in the same assembly, but cannot be inherited from outside of the assembly. I do want the type to be visible outside of the assembly.
Is this possible?
You can make the constructor internal:
public class MyClass
{
internal MyClass() { }
}
Every class that derives from a base class must call a constructor of the base class in its constructor. Since it can't call the constructor if the base class is in a different assembly, the derived class doesn't compile.