【发布时间】:2021-05-16 13:48:32
【问题描述】:
我们有一个使用 .NET 4.8 和 Visual Studio 2015 Shell(隔离)开发的应用程序。现在,每当更新到 KB4601050 后停靠工具窗口时,此应用程序就会崩溃。
我已尝试按照知识库文章中的说明将开关添加到 app.config 文件中,但没有效果。
<configuration>
<runtime>
<AppContextSwitchOverrides value="Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true; Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true" />
</runtime>
</configuration>
我有什么办法可以补救这种情况?
应用程序:xxxxx.exe 框架版本:v4.0.30319 说明:进程因未处理的异常而终止。 异常信息:System.NullReferenceException 在 System.Windows.Interop.HwndMouseInputProvider.HasCustomChrome(System.Windows.Interop.HwndSource,RECT ByRef) 在 System.Windows.Interop.HwndMouseInputProvider.GetEffectiveClientRect(IntPtr) 在 System.Windows.Interop.HwndMouseInputProvider.PossiblyDeactivate(IntPtr,布尔值) 在 System.Windows.Interop.HwndMouseInputProvider.Dispose() 在 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr,MS.Internal.Interop.WindowMessage,IntPtr,IntPtr,布尔 ByRef) 在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr,Int32,IntPtr,IntPtr,布尔 ByRef) 在 MS.Win32.HwndWrapper.WndProc(IntPtr,Int32,IntPtr,IntPtr,布尔 ByRef) 在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System.Object,Int32) 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,System.Delegate,System.Object,Int32,System.Delegate) 在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System.Object,Int32) 在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
【问题讨论】:
-
你能试试这个变通方法来检查它是否有效吗?使用标题“库消费者的 AppContext”下的 AppContext 类(系统)中描述的方法之一设置两个 AppContext 开关。详情请参考here。
-
我能够通过设置注册表项来使其工作。将开关添加到应用程序,配置文件不起作用。请注意,链接文章中注册表项的路径不正确。 Microsoft 和 .NETFramework 之间应该有一个斜线。
标签: .net wpf visual-studio windows-update