Look at
this post for my reference. You might remember it... ;)
What leads me to believe the debugger is actually causing the exception is what I have witnessed trying to resolve my problem described in the thread above. Same situation, application works fine alone, but the moment I attached ReportGenerator to my app's process, access violations in a loop. Application keeps working, but ReportGenerator logs hundreds of access violation exceptions. Mind you, this is all conjecture as only an inspection of your tool's source code would answer it, but I suspect your debugger actually (incorrectly) handles the exception thrown, without re-throwing it. For example, let's assume the debugger attaches to the tested application and then sits in a loop waiting for exceptions.
Try
Do
' Polling loop here, might be some other construct but that doesn't really matter.
' Possibly trying to read from application's allocated memory in here, causing the exception loop in the first place.
Loop
Catch ex As AccessViolationException
' Here the debugger catches the exception and reports it. After that it should re-throw the exception to let the application handle it.
Throw ex ' <== I suspect this is missing in the debugger
' Without the Throw, the exception is handled, and never gets to the application.
End Try
That error handling block (without the Throw) would likely cause the same symptoms both me and Muruqan saw.
Actually, assumption that the tested application did not crash and the quoted excerpt was the reason of why I wrote that the reported first chance exception may be ignored if it is expected by the tested application's design. |
If the tested application does not crash, either as you say it does handle the exception (which it cannot if it is not a .NET application using framework 2.0 or 3.5, or 4.0 with the special attribute set on the assembly) or it never gets the exception.