Can I make a type “sealed except for internal types”
问题 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? 回答1: 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