To work around this problem, set two AppContext switches using one of the methods described in AppContext Class (System) under the heading “AppContext for library consumers”. The switches are named Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix and Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix and both should be set to “true”. The first switch avoids the crash, but re-introduces the bug fixed in the KBs. The second switch is currently ignored, but will be recognized in a future .NET update that contains a fix for the null-reference crash; it restores the original bug fix.
For example, using the app.config file method to apply the workaround at application scope:
<AppContextSwitchOverrides value="Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true; Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true " />