Results 1 to 2 of 2

Thread: How to debug application after an exception error?

  1. #1
    .NET Framework
    .NET 3.5
    Join Date
    Feb 2018
    Posts
    1
    Rep Power
    0

    Question How to debug application after an exception error?

    I wrote a C# application (.NET 4 Client Profile) which runs under Win64. Basically it works but from time to time I get an exception error message and the application crashes after I pressed
    OK to the exception window.

    The main problem is that it is difficult to locate problem in respect to my code I wrote because with the cryptic exception message I get. On the other hand it is a problem with a windows
    driver (antiv virus scanner) and/or connected hardware on the same machine (PC).



    Question:
    What is the best way to isolate or find out where the problem is when I get such exception message again? Can I run a debugger or so to trace back in my code to locate the exact position
    in my code?

    Thanks in advance

  2. #2
    .NET Framework
    .NET 4.5
    Join Date
    Apr 2011
    Posts
    1,934
    Rep Power
    149
    The first thing to do would be to add a global exception handler to your application. You can then log the exception and use that information later. One of the important things is the stack trace, which will tell you exactly where the exception was thrown. You can then add some tracing code around that area to provide information about the application state that you can use the next time an exception is thrown. If you have VS installed on the machine running the application then you should be able to attach a debugger to the process.

Similar Threads

  1. Replies: 4
    Last Post: 01-05-2018, 8:01 AM
  2. Replies: 1
    Last Post: 11-12-2017, 5:59 PM
  3. Question Web application was configured to return informative error messages
    By yugesh65n in forum Web Security
    Replies: 0
    Last Post: 07-02-2017, 5:07 PM
  4. Application has stopped working error
    By eljainc in forum Windows Forms
    Replies: 2
    Last Post: 11-27-2014, 2:59 AM
  5. debug windows
    By jassie in forum IDE
    Replies: 0
    Last Post: 02-07-2013, 3:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •