通过TeamViewer连接时,全屏WPF应用程序崩溃

我已经创建了一个非常稳定的WPF应用程序。 但是有一个问题我无法解决。

当我通过TeamViewer(版本11)连接到运行我的WPF应用程序的平板电脑时(在全屏模式下),应用程序崩溃。 当我结束远程连接时也是如此。

我有以下exception:

System.ComponentModel.Win32Exception (0x80004005): Cannot create a file when that file already exists at MS.Win32.UnsafeNativeMethods.GetWindowText(HandleRef hWnd, StringBuilder lpString, Int32 nMaxCount) at System.Windows.Automation.Peers.WindowAutomationPeer.GetNameCore() at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() at System.Windows.ContextLayoutManager.fireAutomationEvents() at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 

我假设问题出现在我的代码中并且不是TeamViewer的错误。 我已经在搜索GetWindowText()方法但没有成功。 StackOverFlow上唯一一个引用相同exception的线程也无法帮助我。

希望有人可以告诉我为什么会发生这种exception。