Vincent
Vincent

Reputation: 1557

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

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

Upvotes: 25

Views: 5843

Answers (3)

Manish Dubey
Manish Dubey

Reputation: 714

All answers described here do not guarantee 100% cure. What I am doing as a workaround is that just stepping over to the next line while debugging.After that I can see the value of that variable in the watch on mouse hover. (In my case, stepping over to next line does not change value)

Upvotes: 0

Jack Zhai
Jack Zhai

Reputation: 6436

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

Upvotes: 2

Dipen Shah
Dipen Shah

Reputation: 26085

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

Upvotes: 40

Related Questions