tags:

views:

227

answers:

3

When I run my C# program it throws an Stack Overflow exception in one of the methods on a DLL that I have a reference to it in my solution. but no debugging info is available to me because it says it is an stack overflow exception and no info is available. what are the next debugging steps that I should follow to understand what is going on and why ?

thanks

Edit: here is the code that stops at:

static public Collection SortCollection(Collection oCollection, string sPropertyName, string sKeyPropertyName)
{ 
    return SortCollection(oCollection, sPropertyName, sKeyPropertyName); 
} 
+13  A: 

In 99% cases root cause is infinite recursion.

Andrey
Well, yeah, but I think the point of his question is that he needs to find out *where* or *why* the infinite recursion is happening. This is a little bit like saying that an `OutOfMemoryException` means you have a memory leak.
Aaronaught
@Aaronaught, you are right, but take a look at edited post.
Andrey
+2  A: 

You could try downloading .NET Reflector Pro. .NET Reflector (the base product) allows you to "decompile" .NET assemblies, giving you the ability to view the source code.

.NET Reflector Pro takes it one step further and allows you to debug through the source code of any arbitrary .NET assembly.

Pro is not free, but there is a short trial period.

http://www.red-gate.com/products/reflector/

Andy White
yea, it is good tool, I have its pro version. but in this case that DLL is ours, so I have its source code and can attahc it to my solution file to compile it.
BDotA
+2  A: 

Looking at your code, the method SortCollection just keeps calling itself over and over. That will create an infinite loop.

You need to do something inside the function to make it eventually stop calling itself, like Andrey says in his comment.

Tim Ridgely
correct, the problem was that it has a been an Overload version of a bigger method but since the parameters are the same it is calling itself instead of calling the correct version
BDotA