Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0146

Circular base class definition between 'class1' and 'class2'

The inheritance list for a class includes a direct or indirect reference to itself. A class cannot inherit from itself.

The following sample generates CS0146:

// CS0146.cs
namespace x
{
   public interface a
   {
   }

   public class b : a, c
   {
      public void Main()
      {
      }
   }

   public class c : b   // CS0146
   {
   }
}
Show:
© 2015 Microsoft