Is there a way to allow only certain classes to inherit this class?
Yes. If the inheriting code is partially trusted, you can place the inheritance requirement in the base class, and the runtime will not allow the inheritance class to load if it does not meet the demand conditions:
https://msdn.microsoft.com/en-us/library/x4yx82e6(v=vs.100).aspx
Of course, full trust means full trust. Fully trusted code can inherit whatever it wants.
I suspect that you are trying to introduce restrictions that you really should not try to impose. Can you describe why you are trying to do this difficult thing? Perhaps the best way to do what you want.
UPDATE:
I am trying to limit inheritance inside my classes in the same assembly.
Then you probably should have said that first.
Make all class constructors internal. To inherit from a class, it must have an accessible constructor. If you do all the internal constructors, then only the classes in this assembly can inherit the base class.
Eric Lippert
source share