Im trying to use create a func for double.CompareTo.
Im creating it like this:
var method = typeof(double).GetMethod("CompareTo", new Type[] { typeof(double) });
var func = (Func<double, double, int>)Delegate.CreateDelegate(typeof(Func<double, double, int>), method);
It works fine for string.CompareTo like this:
var method = typeof(string).GetMethod("CompareTo", new Type[] { typeof(string) });
var func = (Func<string, string, int>)Delegate.CreateDelegate(typeof(Func<string, string, int>), method);
I get an Argument exception saying That "the target method cannot be bound to since its signature or security transparency is not compatible with the delegate type" (freely translated from Swedish)
What is wrong?