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.

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

C# Compiler Error CS0442 – ‘Property’: abstract properties cannot have private accessors Reason for the Error You’ll get this error...
This is a really simple one . Below is a simple example of an enum called “Designation” defined with the...
This blog post explain the usage of the Checked Block in .NET and how you can use them in Visual...