C# Error CS0754 – A partial method may not explicitly implement an interface method

C# Error

CS0754 – A partial method may not explicitly implement an interface method

Reason for the Error & Solution

A partial method may not explicitly implement an interface method.

A partial method cannot be declared as an explicit implementation of a method defined in an interface.

To correct this error

  1. Remove the explicit interface qualification from the method declaration.

Example

The following code generates CS0754:

// cs0754.cs  
using System;  
  
    public interface IF  
    {  
        void Part();  
    }  
  
    public partial class C : IF  
    {  
        partial void IF.Part(); //CS0754  
        public static int Main()  
        {  
            return 1;  
        }  
    }  

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...