小编Mat*_*s G的帖子

C# .NET WPF 应用程序随机挂起 (WgxConnection_ShouldForceSoftwareForGraphicsStreamClient)

我使用以下库编写了一个 WPF .NET 应用程序 (.NET 4.5):

  • 系统.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...有人有什么想法吗?

编辑:

刚刚找到片段“UnsafeNativeMethods.WgxConnection_ShouldForceSoftwareForGraphicsStreamClient();” 在 MediaSystem.cs 中: https://referencesource.microsoft.com/#PresentationCore/Core/CSharp/System/windows/Media/MediaSystem.cs

--> wpfgfx_v0400.dll

也许“RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;” 可以改变行为吗?

.net c# wpf mvvm

5
推荐指数
1
解决办法
1327
查看次数

标签 统计

.net ×1

c# ×1

mvvm ×1

wpf ×1