Exception Breakpoint on Application Termination

I am using C# 2005 Express edition. My application runs fine but on closing I get the following message (for some reason I can't take a screenshot of the dialog)
The exception breakpoint
A breakpoint has been reached
(0x80000003) occurred in the application at location 0x7c90130
This happens in the debug version and release version.
My first reaction was that I had left a breakpoint in the program, my second that it is related to the debug version. I am new to C#2005 and could not find any swicth to change the build type from debug to release so don't know if calling for a Build automatically created a Build version.
I would like to get rid of it since it would be annoying for my users
Thanks in advance


Answer this question

Exception Breakpoint on Application Termination

  • Alex Merchant

    Well in the end it was very simple - just a case of me not disposing a directX device before closing down
  • arkiboys

    i think you just left a line for a debugger break:

    System.Diagnostics.Debugger.Break();


  • Kirill Tropin

    It sounds like your program is executing code in some DLL and that DLL has found something really wrong, like a destroyed heap. It is fairly common to program a debugger break instruction in the code so that a debugger gets a chance to stop. Fixing this is probably going to be tough. Try having the debugger break there by turning off the "Just my code" option.


  • Joe Au

    Oh yes, ultimately, the CLR needs to dip into the OS to get anything done. There is no such thing as a managed Windows OS. Or video driver. I doubt there'll ever be...


  • Dvlnblk

    If any of the post(s) were helpful to you in finding out debugging the problem...mark them as the Answer. It may help those in similar situations. Thanks.


  • ennisb

    >> just a case of me not disposing a directX device before closing down

    Well, you beat me. I was just about to write that, in my C++ days, I would get that error when I failed to destroy a COM object before shut down.


  • yanivpinhas

    This has taught me that managed code is not always that managed . Seems to be especially true of anything related to GDI+ or DirectX.

  • BioGeek

    Thanks for your help - I have looked for the "just my code option" in the  IDE but can't find it - is it available in the Express Edition
     
    Thanks
     
    EDIT
     
    OK can that - I should read the help text before asking silly questions
     

  • Anarchy

    Something about the way the code handles the shutdown is not playing right. It could be an open resource or unamanged code you are accessing is causing problems. Or maybe a class/object/resource has been properly disposed and other code is trying to access that newly disposed reference. (Put it more null checks before use for that...).

    Your best bet is to place a breakpoint, you may have to divide and conquer, before finding the offending area, but that will give you a clue to what is going on and to remedy it.


  • Exception Breakpoint on Application Termination