How do I track down the cause of a StackOverflowException in .NET?
I get a StackOverflowException when I run the following code: private void MyButton_Click(object sender, EventArgs e) { MyButton_Click_Aux(); } private static volatile int reportCount; private static void MyButton_Click_Aux() { try { /*remove because stack overflows without*/ } finally { var myLogData = new ArrayList(); myLogData.Add(reportCount); myLogData.Add("method MyButtonClickAux"); Log(myLogData); } } private static void Log(object logData) { // my log code is not matter } What could be causing the StackOverflowException ? I know how to stop it from happening I just don't know why it