The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Compiler Error CS0466

'method1' should not have a params parameter since 'method2' does not

You cannot use params parameter on a class member if the implemented interface doesn't use it.

The following sample generates CS0466.

// CS0466.cs
interface I
   void F1(params int[] a);
   void F2(int[] a);

class C : I
   void I.F1(params int[] a) {}
   void I.F2(params int[] a) {}   // CS0466
   void I.F2(int[] a) {}   // OK

   public static void Main()
      I i = (I) new C();

      i.F1(new int[] {1, 2} );
      i.F2(new int[] {1, 2} );
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft