Compiler Warning (level 2) CS0467

Ambiguity between method 'method' and non-method 'non-method'. Using method group.

Inherited members with same signature, from different interfaces, cause ambiguity error.

Example

The following example generates CS0467.

// CS0467.cs
interface IList 
{
int Count { get; set; }
}
interface ICounter
{
void Count(int i);
}

interface IListCounter : IList, ICounter {}

class Driver 
{
    void Test(IListCounter x)
    {
        x.Count = 1;
        x.Count(1);   // CS0467
        // To resolve change the method name "Count" to another name.
    }
    
    static void Main() 
    {
    }
}

See Also

Tasks

How to: Enable or Disable Compiler Warnings