Solved

Application stalled and now I get an exception?

Posted on 2014-01-10
8
275 Views
Last Modified: 2014-01-13
Not sure what caused this but my application stalled on startup so I stopped the execution and then restarted my app. When I got the point in the image it threw an exception (see attachment). Any ideas on why this happened and how to resolve it?

thanks,
Screenshot.jpg
0
Comment
Question by:BlakeMcKenna
  • 4
  • 3
8 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 39772883
Hi BlakeMcKenna;

It is hard to tell from the exception dialog box. What is more helpful is to see if there is any inner exception which would be more meaningful. When you get this exception in the section of the dialog box "Action" click on Copy exception details to the clipboard then post that into a Code block, Code icon above. Also see if this is occurring in your code, "Make sure you do not have an infinite loop or infinite recursion. Too many method calls is often indicative of a very deep or unbounded recursion".
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39773364
Since this happens on the declaration of Private variables, it is outside of a method, so I would not look for recursion, even it if is the most common cause of a StackOverflowException.

We would need to see more of the code to understand what happens.

Could it be in the déclarations of a Structure? Structures should be small objects. Microsoft suggests no more than 16 bytes for a Structure. In such a case, changing the Structure to a Class could solve the problem
0
 

Author Comment

by:BlakeMcKenna
ID: 39776686
I figured it out. It was a Private declaration to instantiate a Form from the main assembly.

Public Class FileIndicator

     Private BH As New BusinessLayer.CalBusiness
     Private EH As New ErrorHandling.ErrorHandler

     Private frm As New frmEquipmentSetup    'Line in question

Open in new window


Not sure why this would do that. When I came to the line in question, it executed then went back up to the first declaration of the BH variable, which started an infinite loop. I don't understand why it would do that though?
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 62

Expert Comment

by:Fernando Soto
ID: 39776704
So this is what caused the error, "Make sure you do not have an infinite loop or infinite recursion. Too many method calls is often indicative of a very deep or unbounded recursion".

Good, glad to see you found it.
0
 

Author Comment

by:BlakeMcKenna
ID: 39776716
But I don't understand why it would execute that statement and then return to the top of the declarations?
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 39776736
As far why that declaration was causing an infinite loop I would suspect that creating that form frmEquipmentSetup  makes a new  FileIndicator instance which call starts the infinite loop going.
0
 

Author Comment

by:BlakeMcKenna
ID: 39776940
that makes sense!

thanks
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 39776952
Did you mark the correct post as the solution?
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question