Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

Application stalled and now I get an exception?

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
BlakeMcKenna
Asked:
BlakeMcKenna
  • 4
  • 3
1 Solution
 
Fernando SotoRetiredCommented:
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
 
Jacques Bourgeois (James Burger)PresidentCommented:
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
 
BlakeMcKennaAuthor Commented:
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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Fernando SotoRetiredCommented:
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
 
BlakeMcKennaAuthor Commented:
But I don't understand why it would execute that statement and then return to the top of the declarations?
0
 
Fernando SotoRetiredCommented:
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
 
BlakeMcKennaAuthor Commented:
that makes sense!

thanks
0
 
Fernando SotoRetiredCommented:
Did you mark the correct post as the solution?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now