C# Error
CS1751 – Cannot specify a default value for a parameter array
Reason for the Error & Solution
Cannot specify a default value for a parameter array.
Example
The following sample generates CS1751:
// CS1751.cs
void Method(params object[] values = null)
{
}
Solution
// Explicitly passing null
object[] values = null;
Method(values);
void Method(params object[] values)
{
if (values == null)
{
}
}
For more information, see .