C# Error CS0527 – Type ‘type’ in interface list is not an interface

C# Compiler Error

CS0527 – Type ‘type’ in interface list is not an interface

Reason for the Error

You’ll get this error in your C# code when you try to inherit a struct or interface from any other type apart from an interface.

For example, let’s try to compile the below C# code snippet.

using System;
namespace DeveloperPublishNamespace
{
    public interface IDeveloperPublish : int
    {
    }

    class Program
    {
      
        static void Main(string[] args)
        {
            Console.WriteLine("No Error");
        }
    }
}

You’ll receive the error code CS0527 in the above code snippet because you are trying to inherit the interface IDeveloperPublish from an int type instead of another interface.

Error CS0527 Type ‘int’ in interface list is not an interface DeveloperPublish C:\Users\SenthilBalu\source\repos\ConsoleApp4\ConsoleApp4\Program.cs 4 Active

C# Error CS0527 - Type 'type' in interface list is not an interface

Solution

In C#, the struct and interfaces can inherit from an interface only.

To fix this error in your C# code, you will need to non-interface inheritance from the struct or interface definition.