【发布时间】:2017-06-17 02:54:54
【问题描述】:
我使用以下库编写了一个 WPF .NET 应用程序 (.NET 4.5):
- System.Windows.Interactivity.dll
- Microsoft.Practices.ServiceLocation.dll
- GalaSoft.MvvmLight.Platform.dll
- GalaSoft.MvvmLight.Extras.dll
- GalaSoft.MvvmLight.dll
我使用 2 个计时器:
-
System.Threading.DispatcherTimer(每 200 毫秒打勾)- 只需将绑定到标签的 DateTime 属性设置为 DateTime.Now。
-
System.Timers.Timer(每秒滴答声)- 将焦点设置到文本框,从 Web 服务请求数据(在异步任务中)
- 更新绑定到 Datagrid 的 ICollectionView(使用
Application.Current.Dispatcher.BeginInvoke)
应用程序在大约 50 台 Windows 7 机器上运行(从早上 7 点到下午 5 点),没有任何问题。
仅在 1 台 Windows 7 机器上,它只是随机冻结,CPU 使用率高且唯一活动线程:WgxConnection_ShouldForceSoftwareForGraphicsStreamClient
Windows 事件日志中没有条目,也没有触发此事件的用户事件。
我找不到关于此WgxConnection... 的任何信息有人有任何想法吗?
编辑:
刚刚找到sn -p "UnsafeNativeMethods.WgxConnection_ShouldForceSoftwareForGraphicsStreamClient();"在 MediaSystem.cs 中: https://referencesource.microsoft.com/#PresentationCore/Core/CSharp/System/windows/Media/MediaSystem.cs
--> wpfgfx_v0400.dll
也许“RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;”可以改变行为吗?
【问题讨论】: