-
Notifications
You must be signed in to change notification settings - Fork 174
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
Expiration date parsing exception not handled #26
Comments
Could you please post a complete stack trace of that exception? |
Sure: System.FormatException: String was not recognized as a valid DateTime because the day of week was incorrect. Stack trace: at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style) |
I'm having the same issue... See related github issue here <Expiration>Fri, 31 Dec 9999 23:59:59 GMT</Expiration> This date blows up on just some of my customer's machines. I have not been able to repro on any environment. Below is a screenshot that one of them sent me. |
Looks like when you have a license with a expiration date of DateTime.MaxValue which is (Fri, 31 Dec 9999 23:59:59 GMT), some version of visual studio/.net fail. I was unable to replicate this on vs 2012, 2013, 2015 but other user's of my project were. My solution was to generate a permanent license that expires in a 100 years instead of using DateTime.MaxValue. |
When testing modifying the expiration date in the license file, it appears that the DateTime parsing exceptions are not handled and translated into a proper IValidationResult. Instead, an exception is thrown as soon as the result is accessed. An example exception: "String was not recognized as a valid DateTime because the day of week was incorrect."
I'm working around this by surrounding my validation check in a try block, but it would be nice for invalid expiration dates to trigger the normal "License signature validation error" message.
Great work, thanks for this!
The text was updated successfully, but these errors were encountered: