Make abstract class only visible to my classes
I have an abstract class and I only want it visible to my classes only. If somebody references the library, I don't want them to be able to inherit from my abstract class.
Code:
// Class1.cs
abstract class Class1
{
}
Code:
// Class2.cs
public class Class2 : Class1
{
}
The compile error tells me Class1 is less accessible than Class2.
Making Class1 public works but it makes it visible and (inheritable) by any other class but I only want it to be inherited by the classes I specify. Is this possible or necessary?
Re: Make abstract class only visible to my classes
Use internal instead of public.
It makes your class only accessible for the project in which it is located.
Re: Make abstract class only visible to my classes
excuse my previous post, it doesn't address your problem effectively.