473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

debugging IComparer exceptions

Hello,

I'm very often in troubles debugging an ArrayList.Sort() method. I'm
so often getting this error:

"An unhandled exception of type 'System.InvalidOperationException'
occurred in mscorlib.dll

Additional information: Specified IComparer threw an exception."

and the call stack points just after the ArrayList.Sort() line.

I would really like the debugger to break into the IComparer
implementation pointing to the line throwing the exception.

I build several genetic optimizers, that sort genomes using complex
Fitness function and it's so bad I always need to perform a step by
step debug just to get to the line throwing the exception.

I'm using VisualStudio.net 2002.

I bet I'm missing something simple, but I've not been able to google
anything useful. Any help would be really much appreciated.

Thanks for your time.

Jul 14 '07 #1
1 1881
check this out

http://www.thescripts.com/forum/thread512205.html
Husam Al-áraj
www.aaraj.net
"an******@hotpop.com" wrote:
Hello,

I'm very often in troubles debugging an ArrayList.Sort() method. I'm
so often getting this error:

"An unhandled exception of type 'System.InvalidOperationException'
occurred in mscorlib.dll

Additional information: Specified IComparer threw an exception."

and the call stack points just after the ArrayList.Sort() line.

I would really like the debugger to break into the IComparer
implementation pointing to the line throwing the exception.

I build several genetic optimizers, that sort genomes using complex
Fitness function and it's so bad I always need to perform a step by
step debug just to get to the line throwing the exception.

I'm using VisualStudio.net 2002.

I bet I'm missing something simple, but I've not been able to google
anything useful. Any help would be really much appreciated.

Thanks for your time.

Jul 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lloyd Sheen | last post by:
Is there a setting in VS2003 to ensure that when debugging a page it will stop on all errors. At present it just displays a page with the error but I want it to stop at that line when the error...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
4
by: Martin Odhelius | last post by:
Hello, I have a very fustrating problems while debugging ASP.NET applications. When I am debugging and stepping thru code (with F10 or F11) Visual Studio some times suddenly just stop responding...
10
by: INeedADip | last post by:
I am trying to use a generic (reflection) IComparer class to sort a generic list but I get the error: Unable to cast object of type 'GenericComparer' to type 'System.Collections.Generic.Icomparer...
5
by: James Ma | last post by:
Now I am debugging a buggy VB.NET function like following Function foo() Try ‘ many loops and codes and nested try catch here! …… Catch (ex as Exception) Msgbox ex.message Finally …
1
by: Brett Romero | last post by:
What are the reasons to use one over the other? SortedList implements IComparer.Compare(). Why would you also want to create a SortedList class that implements IComparable.CompareTo()? I know...
6
by: Rob R. Ainscough | last post by:
I can't seem to locate the appropriate area in VS 2005 where I can accomplish this -- is this a C# only option? Thanks, Rob.
3
by: jtfaulk | last post by:
Re: ArrayList, Sort, Menu, IComparer, Object, multidemensional I have a multi-dimensional arraylist, and I would like to sort one level of it but not all. The multi-dimensional arraylist...
3
dcharnigo
by: dcharnigo | last post by:
I thought I would be tricky and force the SortedList to not sort using a custom IComparer, I used the following code, but when the list is sorting using the custom sort the accessors become unusable...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.