I have a WPF application that correctly runs on Windows Xp and Windows 7. When I installed it on a Windows server 2012, I realized that an error occurred dealing with AutomationPeers. Here's part of the stack trace:
... at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren() at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit) at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() at System.Windows.Automation.Peers.AutomationPeer.UpdatePeer(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
I had a look inside the source code of the control that raised that exception and I realized that that part of code could only run if calls to the static method:
`AutomationPeer.ListenerExists()`
return true.
Why on all other systems, calls to
`AutomationPeer.ListenerExists()`
all return false, while on that windows 2012 server it returns true?
Is there a way to remove those listeners?
Note: my application was built in release mode.