我使用以下库编写了一个WPF .NET应用程序(.NET 4.5):
只有1台Windows 7机器会随机冻结,并且CPU使用率很高,唯一活动的线程是:
Windows事件日志中没有条目,也没有触发此问题的用户事件。
我找不到关于此
编辑:
刚刚在MediaSystem.cs中找到了代码片段"UnsafeNativeMethods.WgxConnection_ShouldForceSoftwareForGraphicsStreamClient();": https://referencesource.microsoft.com/#PresentationCore/Core/CSharp/System/windows/Media/MediaSystem.cs --> wpfgfx_v0400.dll
也许"RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;"可以改变行为?
- System.Windows.Interactivity.dll
- Microsoft.Practices.ServiceLocation.dll
- GalaSoft.MvvmLight.Platform.dll
- GalaSoft.MvvmLight.Extras.dll
- GalaSoft.MvvmLight.dll
System.Threading.DispatcherTimer
(每200毫秒滴答一次)- 仅将DateTime属性设置为DateTime.Now,并将其绑定到标签。
System.Timers.Timer
(每秒钟滴答一次)- 将焦点设置到文本框,从Web服务请求数据(在异步任务中)
- 更新绑定Datagrid的ICollectionView (使用
Application.Current.Dispatcher.BeginInvoke
)
只有1台Windows 7机器会随机冻结,并且CPU使用率很高,唯一活动的线程是:
WgxConnection_ShouldForceSoftwareForGraphicsStreamClient
。Windows事件日志中没有条目,也没有触发此问题的用户事件。
我找不到关于此
WgxConnection...
的任何信息。是否有人有任何想法?编辑:
刚刚在MediaSystem.cs中找到了代码片段"UnsafeNativeMethods.WgxConnection_ShouldForceSoftwareForGraphicsStreamClient();": https://referencesource.microsoft.com/#PresentationCore/Core/CSharp/System/windows/Media/MediaSystem.cs --> wpfgfx_v0400.dll
也许"RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;"可以改变行为?