Tuesday, September 20, 2011

Argument 1: cannot convert from 'method group' to 'System.Threading.ThreadStart'

The best overloaded method match for 'System.Threading.Thread.Thread(System.Threading.ThreadStart)' has some invalid arguments

These errors occur when the Method that is called has parameters other than object. The compiler expects the signature to take object

var t1 = new Thread(ExecuteTasks);

will throw an error if the method signature is like this

private  static void ExecuteTasks(int iInput)

The following one is acceptable

private  static void ExecuteTasks(object iInput)

No comments:

Post a Comment