No overload for method 'method' takes 'number' arguments
A call was made to a class method, but there is no form of the method that takes the necessary number of arguments.
CS1501 could occur when you allocate memory for a delegate; you must also specify the name of the method that the delegate represents.
The following sample generates CS1501:
public class a { /* declare the following constructor to resolve this CS1501 public a(int i) { } */ public static void Main() { a aa = new a(2); // CS1501 } }
The following sample generates CS1501:
using System; delegate string func(int i); // declare the delegate class a { static func dt; // class member-field of the declared delegate type public static void Main() { // dt = new func(); // CS1531 // try the following line instead dt = new func(z); // this works x(dt); } public static string z(int j) { Console.WriteLine(j); return j.ToString(); } public static void x(func hello) { hello(8); } }