Application has stopped working error in C# .NET application
-
Hello, I am running into some problems with a program that I've written and I need some help. It is a C# .NET 2.0 Winforms application. It is being executed from a network drive, and runs under Windows XPand Windows 7. The platform target is x86. It does some SQL queries, reading and writing to a file stored on a network using SQLite. There are certain operations, which are not repeatable, in which the user will click and the program will simply stall, going into the hourglass (or spinning circle). Usually when this happens, the program will crash with "The application has stopped working" error. I have an exception handler, but apparently it is not catching the problem. What measures can I take to find out the problematic code? Or to correct the errors? The users of the program get frustrated when the crashes occur as it slows down their work. Thanks Mike
-
Hello, I am running into some problems with a program that I've written and I need some help. It is a C# .NET 2.0 Winforms application. It is being executed from a network drive, and runs under Windows XPand Windows 7. The platform target is x86. It does some SQL queries, reading and writing to a file stored on a network using SQLite. There are certain operations, which are not repeatable, in which the user will click and the program will simply stall, going into the hourglass (or spinning circle). Usually when this happens, the program will crash with "The application has stopped working" error. I have an exception handler, but apparently it is not catching the problem. What measures can I take to find out the problematic code? Or to correct the errors? The users of the program get frustrated when the crashes occur as it slows down their work. Thanks Mike
Intermittent errors are the worst to try and find: if you can't duplicate it, you can't fix it. And "The application has stopped working" tells you (and I) nothing at all about why it stopped - it's a generic message that you app did something it wasn't supposed to. So the first thing you need is information! You are going to have to add logging to your app - to try and work out roughly where it is when it crashes. I'd suggest starting at a high level, and logging the rough areas the user is using: enter and exit event handlers to a file until you can get a "feel" for which handlers are causing the problem. Then you can focus more logging into the methods that calls to try and work out what it's doing. Using File.AppendAllText is the simplest method, and should be relatively unobtrusive (util you get down into the nitty-gitty of low level methods, anyway). Try to keep old log files by renaming them when your app starts. Going to take a while, I'm afraid - but there isn't a lot else you can do until you know roughly what area it is crashing in.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
Hello, I am running into some problems with a program that I've written and I need some help. It is a C# .NET 2.0 Winforms application. It is being executed from a network drive, and runs under Windows XPand Windows 7. The platform target is x86. It does some SQL queries, reading and writing to a file stored on a network using SQLite. There are certain operations, which are not repeatable, in which the user will click and the program will simply stall, going into the hourglass (or spinning circle). Usually when this happens, the program will crash with "The application has stopped working" error. I have an exception handler, but apparently it is not catching the problem. What measures can I take to find out the problematic code? Or to correct the errors? The users of the program get frustrated when the crashes occur as it slows down their work. Thanks Mike
Those kinds of errors typically happen in non-UI portions of your code, otherwise you'd get the familiar 'Unhandled Exception' dialog with the continue or quit buttons. If I were a betting sort, I'd look closely at how you're handling (and likely not) exceptions within portions of code where your SQL queries are run. Sounds like some attempt(s) made to connect fail or abort, and then the code crashes due to the unhandled exception taking place (likely in another thread or class).
The madman is not the man who has lost his reason; the madman is the man who has lost everything except his reason. --G.K. Chesterton
-
Hello, I am running into some problems with a program that I've written and I need some help. It is a C# .NET 2.0 Winforms application. It is being executed from a network drive, and runs under Windows XPand Windows 7. The platform target is x86. It does some SQL queries, reading and writing to a file stored on a network using SQLite. There are certain operations, which are not repeatable, in which the user will click and the program will simply stall, going into the hourglass (or spinning circle). Usually when this happens, the program will crash with "The application has stopped working" error. I have an exception handler, but apparently it is not catching the problem. What measures can I take to find out the problematic code? Or to correct the errors? The users of the program get frustrated when the crashes occur as it slows down their work. Thanks Mike
The only thing you can do in situations such as this, is to try and do some debugging to find out where it is hanging, and what circumstances are occurring at the time. What operations are the users doing, and what does that cause the application to do? Is it perhaps getting stuck accessing the network drive?