Visual Studio crashes when docking windows (TL;DR: it wasn't us)
Monday 22nd February, 2021
We've all done it. You prepare a new build, install it, start testing before releasing it and then...it crashes. The immediate thought is always "What have we done...?".
Exactly that happened to us recently when testing a Visual Lint build - all we did was dock a window and then Visual Studio crashed and restarted.
So, what had we done? As it turns out, nothing - the crash was actually caused by a Windows 10 update - and happened irrespective of whether any third party extensions are installed. KB4598301 is reportedly the cause, though others (e.g. KB4598299) also seem to cause the same effects.
The following community post has more details of the bug and possible workarounds:
We have no doubt that Microsoft will fix this very soon (in Visual Studio 2017 and 2019, at least) so for now we're not too worried, but in the meantime - or if you're using an older version of Visual Studio - the workarounds are to uninstall the update, or edit
If you decide to do the latter, check to see if the if the
configuration/runtime/AppContextSwitchOverrides element exists. If it does append the following to its value:
If however the element does not exist (it may not for older versions of Visual Studio), you can just add it:
<AppContextSwitchOverrides value="Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true;Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true" />
Once you restart Visual Studio you should then be good to go.