1
Vote

Crash when sorting by Release Date

description

I've downloaded the latest version and tried to sort by Release Date. The application throws an unhandled exception. It might help to know that I have none of the tools installed on my machine.
 
 
************** Exception Text **************
System.InvalidOperationException: Failed to compare two elements in the array. ---> System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.DateTime.Parse(String s, IFormatProvider provider)
at Microsoft.VSPowerToys.PackInstallerDataModel.ToolItemComparer.System.Collections.Generic.IComparer<Microsoft.VSPowerToys.PackInstallerDataModel.ToolItem>.Compare(ToolItem x, ToolItem y)
at System.Collections.Generic.ArraySortHelper1.QuickSort[TValue](T[] keys, TValue[] values, Int32 left, Int32 right, IComparer1 comparer)
--- End of inner exception stack trace ---
at System.Collections.Generic.ArraySortHelper1.QuickSort[TValue](T[] keys, TValue[] values, Int32 left, Int32 right, IComparer1 comparer)
at System.Collections.Generic.ArraySortHelper1.Sort[TValue](T[] keys, TValue[] values, Int32 index, Int32 length, IComparer1 comparer)
at System.Collections.Generic.ArraySortHelper1.Sort(T[] items, Int32 index, Int32 length, IComparer1 comparer)
at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer1 comparer)
at System.Collections.Generic.List
1.Sort(Int32 index, Int32 count, IComparer`1 comparer)
at Microsoft.VSPowerToys.PackInstallerDataModel.PackLibrary.GetSortedItems(SortByField sortField, SortOrder order)
at Microsoft.VSPowerToys.PackInstaller.PackInstallerForm.LoadPacksToGUI()
at Microsoft.VSPowerToys.PackInstaller.PackInstallerForm.SortItems(Object sender, EventArgs e)
at Microsoft.VSPowerToys.PackInstaller.SortListView.OnMouseClick(MouseEventArgs e)
at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
at System.Windows.Forms.ListView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
 
 
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

PackInstallerRC
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0

CodeBase: file:///M:/kits/development/other/PackInstaller.exe

System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll

System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

System.Deployment
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll

System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

 
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
 
For example:
 
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
 
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

comments

Gmos wrote May 27, 2007 at 8:24 PM

Have the same problem. Also doing other things than sort by release date.Probable cause: I live in the Netherlands. Most likely a localised date is parsed expecting an American format.In Europe we generally swap day and month, as compared to the American format.

Gmos wrote May 27, 2007 at 8:43 PM

It is the other way around.

In: case ToolItem.SortByField.ReleaseDate: { // We need to convert the date string that came out of the feed and convert it // into a DateTime object... DateTime localDate = DateTime.Parse(x.ReleaseDate, Application.CurrentCulture);

The release date (in American format) is interpreted as being Dutch.

wrote Feb 13, 2013 at 4:42 AM