Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual Unhandled exception in Debugger::HandleIPCEvent when breaking on certain breakpoint

Tags:

I get the following exception (in Dutch, English translation follows in the text) which breaks my debugger when I press 'OK' it stops the debug session and closes the application:

enter image description here

Translated in text:

--------------------------- LerTemperaturaWPF.vshost.exe - Application Error --------------------------- INTERNAL ERROR: Unhandled exception in Debugger::HandleIPCEvent. Event ID=0x246. Exception code=0xc0000005, Eip=0x68fbaeca. Process ID=0x1094 (4244), Thread ID=0x10a4 (4260). --------------------------- OK    --------------------------- 

This happens if the first time the debugger breaks are inside a certain piece of code:

private void PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) {     // Set value of property, only when the long editor is selected (no optionlist item is selected)     if (this.Editor.SelectedItem != null)     {         if (this.Editor.SelectedItem as OptionForList == null)         {             this.Editor.SelectedValue = ((Management.Property)this.Editor.SelectedItem).Value;             this.Editor.SelectedIndex = 0;         }     } } 

It happens when I place the breakpoint inside the 2nd if statement, before the second if statement (where ever I place it). It gives me no problems.

If I make sure the first break the debugger has is before this code and afterward it hits a breakpoint in this code there are no problems either. The debugger must have broken before getting to this code. Now I do not think it has anything to do with this code (90% certain).

The property changed is a user control and somehow I think the debugger can't handle the user control properly? maybe?

Has anyone seen this behavior before and know how to fix this? do I need to turn off (or on) some of the debug settings??

like image 694
Vincent Avatar asked Jul 22 '16 12:07

Vincent


People also ask

How do I fix unhandled exception in Visual Studio?

To change this setting for a particular exception, select the exception, right-click to show the shortcut menu, and select Continue When Unhandled in User Code. You may also change the setting for an entire category of exceptions, such as the entire Common Language Runtime exceptions).

How do I stop Visual Studio from breaking on exception?

To turn off stop on exceptions press " Ctrl + Alt + E ". This will open the Exceptions window . Untick "Common Language Runtime Exceptions - Thrown". That would prevent it from pausing from within the delegate, but not when it's rethrown on Wait .

How do I stop exception breakpoint?

Remove breakpoints For non-exception breakpoints: click the breakpoint in the gutter. For all breakpoints: from the main menu, select Run | View Breakpoints Ctrl+Shift+F8 , select the breakpoint, and click Remove Delete .


2 Answers

Right click on the project/solution -> Properties -> Debug -> Check "Enable native code debugging".

like image 120
Dipen Shah Avatar answered Sep 28 '22 12:09

Dipen Shah


(1) On the Debug menu->Windows->Exceptions, and enable all Thrown check boxes. Debug the application, it will show you the actual and detailed errors in a message Box.

(2) Right click on the project/solution -> Properties -> Debug -> Uncheck "Enable visual studio hosting process".

(3) Please also change the Platform target (X86/Any CPU/X64), re-compile the app, debug it again.

(4)Tools > Options > Debugging > General > "Use Managed Compatibility Mode" checkbox.

like image 35
Jack Zhai-MSFT Avatar answered Sep 28 '22 12:09

Jack Zhai-MSFT