It seems that after iterate over the failures collection, calling ToList() or ToArray() doesn't populate it again.
You can test with this code.
I've generated an xml license file (copy/paste from main page), changed the expiration date inside the xml file and called the verification.
Any returns true, but the foreach is skipped.
if (validationFailures.Any()) { validationFailures.ToList(); foreach (var failure in validationFailures.ToList()) list.Items.Add(failure.GetType().Name + ": " + failure.Message + " - " + failure.HowToResolve); } else list.Items.Add("All ok");
It seems that after iterate over the failures collection, calling ToList() or ToArray() doesn't populate it again.
You can test with this code.
I've generated an xml license file (copy/paste from main page), changed the expiration date inside the xml file and called the verification.
Any returns true, but the foreach is skipped.
if (validationFailures.Any()) { validationFailures.ToList(); foreach (var failure in validationFailures.ToList()) list.Items.Add(failure.GetType().Name + ": " + failure.Message + " - " + failure.HowToResolve); } else list.Items.Add("All ok");