This documentation is archived and is not being maintained.

Compiler Error CS0758

Visual Studio 2008

Both partial method declarations must use a params parameter or neither may use a params parameter

If one part of a partial method specifies a params parameter, the other part must specify one also.

To correct this error

  • Either add the params modifier in one part of the method, or remove it in the other.

The following code generates CS0758:

using System;

    public partial class C
    {
        partial void Part(int i, params char[] array);
        partial void Part(int i, char[] array) // CS0758
        {
        }

        public static int Main()
        {
            return 1;
        }

    }
Show: