-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validationFailures.ToList() not working #12
Comments
Hi @Manfrons, I also encountered this errror and the solution was to call validationFailures.ToList() to retrieve the failures. This was written on the README.MD page.
|
Hello, i have the same problem..... When i change date in License file to have a failure i have an exception before putting something in failures list.... |
@dragonfly22000 it seems to be because the date you entered isn't a valid date.
=> certainly need to change the library to take it into account or do a try/catch for this kind of error and return that the license is invalid. |
@sylvainonweb Thanks for the answer ,effectively, i'm going to put a Try catch and make a pop-up in case of exception. |
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");
The text was updated successfully, but these errors were encountered: