This project has moved. For the latest updates, please go here.

BUG: String was not recognized as a valid DateTime

Topics: Errors
Oct 12, 2016 at 8:37 PM
Exception Type: System.FormatException
Message: String was not recognized as a valid DateTime.

The exception occurred at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at Microsoft.Win32.TaskScheduler.Trigger.get_StartBoundary() in C:\Users\dahall\Documents\Visual Studio 2010\Projects\TaskService\Trigger.cs:line 347
at Microsoft.Win32.TaskScheduler.WeeklyTrigger.V2GetTriggerString() in C:\Users\dahall\Documents\Visual Studio 2010\Projects\TaskService\Trigger.cs:line 2798
at Microsoft.Win32.TaskScheduler.Trigger.ToString() in C:\Users\dahall\Documents\Visual Studio 2010\Projects\TaskService\Trigger.cs:line 501
Coordinator
Oct 13, 2016 at 3:07 PM
Will you post the XML for the task that being retrieved and the Windows version you are on? The error is coming from a method that takes the string from the native library, which is usually in a specific format, and is converting it to a DateTime value. This method should not fail unless Microsoft has done something different in their library.
Oct 15, 2016 at 4:06 PM
Unfortunately I don't have the XML data, a user simply submitted the exception data to me.
Coordinator
Oct 17, 2016 at 3:36 PM
I've gone back through the code that handles parsing the StartBoundary and the only explanation I can find for the bug is that the string that the native library returns was in an unexpected format. Without more detail, I have no way to handle that error condition.