かなり安定して動作するWPFアプリを作成しました。しかし、解決できない問題が 1 つあります。
TeamViewer (バージョン 11) を介して WPF アプリが実行されているタブレット (フルスクリーン モード) に接続すると、アプリがクラッシュします。リモート接続を終了しても同じことが起こります。
次の例外が発生しました:
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の唯一のスレッドも役に立ちませんでした。
この例外が発生する理由を誰かが教えてくれることを願っています。