Export to GitHub

eopk - issue #60

EggUpdater fails after downloading the new update.xml file.


Posted on Feb 21, 2010 by Happy Lion

What steps will reproduce the problem? 1. Click Check for Updates on the File menu.

What is the expected output? What do you see instead? I expect that the most recent files would download. The EggUpdater process dies with an invalid format datetime string.

Checking for updates..... [09:09] Checking for new updates [09:09] Downloading update.xml from web. [09:09] There has been an error, please close the updater and try again. [09:09] [CheckForUpdates] Error: String was not recognized as a valid DateTime. [09:09] [CheckForUpdates] StackTrace: at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at EggOfPanKu.Eggupdater.UpdateManager.CheckForUpdates() Unhandled Exception: System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at EggOfPanKu.Eggupdater.UpdateManager.CheckForUpdates() at EggOfPanKu.Eggupdater.Program.GetUpdates() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

What version of the product are you using? On what operating system? 0.9.32 on Windows 7

Please provide any additional information below. Localized to English.

Comment #1

Posted on Feb 24, 2010 by Helpful Kangaroo

Gah! sorry, I am working on this.

Seems that I put a time in there that is not really a correct time format... :(

Comment #2

Posted on Jan 19, 2011 by Happy Lion

This is still an issue.

There are two ways to fix this. The best is to change the following line in WebPaigeDesign.DLL.AutoUpdater.CreateXMLString

builder.AppendFormat("{0}", this.LastUpdated.ToShortDateString());

to

builder.AppendFormat("{0}", this.LastUpdated.ToUniversalTime().ToString("s"));

This change will save the LastUpdated field in GMT in a culture invariant form. This means that people using any culture on their machine will be able to pick up updates as soon as they go up.

Alternatively in UpdateFile.ctor(), change the line

this._lastUpdated = DateTime.Parse(LastUpdated);

to read your specifically chosen date time format. This is a more brittle change than above, as it will break if you ever do change the format string you use for LastUpdate.

Unfortunately, you haven't provided the source of this library, which makes contributing a patch a little more difficult. It only took a few minutes digging around with reflector to find the problem.

Comment #3

Posted on Jan 19, 2011 by Helpful Kangaroo

Thank you for this. I have made the change to the ToUniversalTime() and will upload this later today.

Status: Started

Labels:
Type-Defect Priority-High Component-Logic