开发者

WPF performance issue due to UI Automation

开发者 https://www.devze.com 2023-02-26 15:57 出处:网络
I\'m experiencing an issue described in this thread. dotTrace told me \"Stylus Input\" was guilty. I tried the code posted by Ron Z and Chaim Zonnenberg, but didn\'t work.

I'm experiencing an issue described in this thread.

dotTrace told me "Stylus Input" was guilty.

WPF performance issue due to UI Automation

I tried the code posted by Ron Z and Chaim Zonnenberg, but didn't work.

Rash suggested 2 workarounds:

  1. Automation code will be triggered only if there are any automation clients ( like screen reader, tabtip in tablet pcs, etc) running in the machine. So one way to get out of this situation is to close any of those aut开发者_Go百科omation client apps.

  2. If one is not feasible then an alternative is, UIElementHelper.InvalidateAutomationAncestors will take longer time only if automation tree for the app is sparse ( happens if had disabled building automation tree using custom window automation peer) and visual tree is dense. So another solution is disable any custom automation code and allow WPF to build complete automation tree. This should speed up UIElementHelper.InvalidateAutomationAncestors as well.

But how to close tabtip? I tried to stop and disable the following services but didn't work, tabtip.exe was still running in the background:

  • Tablet PC Input Service
  • TabletServicePen

Rash said this issue should be solved in .NET 4.0 SP1. Anyone knows the release date of .NET 4.0 SP1?

I'm using Visual Studio 2010, Windows 7 64bit, Wacom Graphire 4.

Thanks


Update:

To close tabtip.exe I just need to restart Windows after disabling the aforementioned services. But this alone didn't solve my issue. In order to workaround the performance issue, I have to also disable "Wacom Consumer Touch Service".

And according to this thread (March 22, 2011):

there is no published timeline for .NET Framework 4.0 sp1


I recently had to deal with this exact problem using a WPF tool on our project.

The machine where the crash was happening is running .NET Framework 4.5.

When the tool was crashing we could see the crash happening in .NET PresentationFramework UIAutomation. The crash exception was: A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in PresentationFramework.dll --> at this point the bug appeared to be in .NET Framework

But then we could see down the stack that we crashed in a UIAutomation call, that lead us to this thread and figured that this module is being trigger by the Wacom services.

The Wacom driver running on the machine where the app is crashing was: Wacom Tablet 6.3.1w3 After downgrading to the previous version everything started working: WacomTablet_6.3.3-4

Now that we knew the source of the problem we started looking into a workaround to be able to still use the latest driver. So here it is and what's nice is that it don’t seem to affect the wacom tablet functionality: - Go to Control Panel. - Double click on Programs and Features - Click on the link on the left titled Turn Windows Features on or off - When that loads, uncheck ‘Tablet PC Optional Components’ (Might be called ‘Tablet PC Components’ in Windows 7). - Click the OK button. This might require you to restart your windows machine.

And that did the trick for us.

Have fun!

0

精彩评论

暂无评论...
验证码 换一张
取 消