Managed Debugging Assistant ‘ContextSwitchDeadlock’

If you run into the ContextSwitchDeadlock issue, it doesn’t mean your code is actually broken. You can actually turn this exception off through the settings menu of Visual Studio. You have a couple of options when it comes to fixing this issue!

This is the error I received:

Managed Debugging Assistant 'ContextSwitchDeadlock'
Managed Debugging Assistant ‘ContextSwitchDeadlock’

There are two simple fixes for this issue, the first is to simply turn the option creating this error message in visual studio.

To turn this option off you need to go to exception settings by clicking Debug -> Windows -> Exception Settings

Open Exception Settings in Visual Studio

After that we need to expand Managed Debugging Assistants and uncheck ContextSwitchDeadlock

ContextSwitchDeadlock option

The other option is going to be just adding Application.DoEvents() to the section of code that is locking up the application and not pumping messages anymore. This way the system will know that the application hasn’t crashed and is still continuing to work properly.

Whichever way you solve the issue, I hope this guide helped! Thanks for reading and I’ll see you in the next one!

Leave a reply

Your email address will not be published.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>