Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Application has stopped working error in C# .NET application

Application has stopped working error in C# .NET application

Scheduled Pinned Locked Moved C#
csharphelpdatabasesqlitewinforms
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eljainc
    wrote on last edited by
    #1

    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

    OriginalGriffO R L 3 Replies Last reply
    0
    • E eljainc

      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

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      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...

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • E eljainc

        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

        R Offline
        R Offline
        Redgum
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • E eljainc

          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

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups