ゼロの Hwnd は無効です。
原因
よくわかっていません。
Visual Studio側の問題(?)
おそらくあなたが書いたコードに問題はありません。
対策
何度かビルドを行ってみる
Ctrl + F5でデバッグなしで開始すると出なくなるはず
#エラー・例外
code:詳細情報
---
アプリケーションの実行中に例外が発生しました。
ゼロの Hwnd は無効です。
---
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (ゼロの Hwnd は無効です。)
---> System.ArgumentException: ゼロの Hwnd は無効です。
at System.Windows.Interop.HwndSource.CriticalFromHwnd(IntPtr hwnd)
at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.Adorners.HitTestHelper.<>c.<GetHwndSourceFromPoint>b__9_0(IntPtr hwnd)
at System.Linq.Enumerable.ListSelectIterator`2.MoveNext()
at System.Linq.Enumerable.TryGetFirstTSource(IEnumerable1 source, Func2 predicate, Boolean& found)
at System.Linq.Enumerable.FirstOrDefaultTSource(IEnumerable1 source, Func2 predicate)
at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.Adorners.HitTestHelper.GetHwndSourceFromPoint(IntPtr hwnd, Int32 x, Int32 y)
at Microsoft.VisualStudio.DesignTools.WpfTap.LivePreview.TapLivePreviewService.CreateResponse(IRootSource root, LivePreviewSelectionRequest data)
at Microsoft.VisualStudio.DesignTools.WpfTap.LivePreview.TapLivePreviewService.ProcessLivePreviewSelectionRequest(IRootSource root, LivePreviewSelectionRequest data)
at Microsoft.VisualStudio.DesignTools.WpfTap.LivePreview.TapLivePreviewService.<>c__DisplayClass23_0.<HandleLivePreviewSelectionRequest>b__1()
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
--- End of inner exception stack trace ---