Update: Still haven't found what is causing the exception, but I think the message of the exception is incorrect. For now I'm sticking with the Knuth Shuffle algorithm from the PowerCollections. As suggested by Cyrus.
int[] ints = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
System.Random rand = new System.Random((int)DateTime.Now.Ticks);
Array.Sort(ints, delegate(int x, int y){
// since you’re not allowed to return anything else than 0 for x.CompareTo(x)
if
}
);
note: This still throws an exception sometimes, claiming x.CompareTo(x) didn't return 0. I haven't found out why this happens or a pattern when this is happening, but I'll keep looking.