C# compiler can't find interface Extension Method?
c#
Solution
Have you marked your extension class as static as well? i.e. The class with the extension method must be marked as static AND the extension method itself must also be static.
public static class AExtensions : IA
{
public static void foo(this IA a) { a.foo(); }
}
Problem
I have an interface: ``` public interface: IA { ... } ``` and I try to extend it into ``` class public A : IA { private static void foo(this IA a) { a.foo(); } } ``` but compiler says, that it can't find foo(), with first parameter of type IA. How can I fix it?