Exception:Attempted to use WebView2 functionality which requires its CoreWebView2 prior to the CoreWebView2 being initialized. Call EnsureCoreWebView2Async or set the Source property first.

报错信息 1
InvalidOperationException: Attempted to use WebView2 functionality which requires its CoreWebView2 prior to the CoreWebView2 being initialized.  Call EnsureCoreWebView2Async or set the Source property first.
StackTrace:
   在 Microsoft.Web.WebView2.Wpf.WebView2Base.VerifyCoreWebView2()
   在 Microsoft.Web.WebView2.Wpf.WebView2Base.Stop()
   在 DynamicClass.<OnWindowCreated>b__2(Object sender, CancelEventArgs e)
   在 System.Windows.Window.OnClosing(CancelEventArgs e)
   在 System.Windows.Window.WmClose()
   在 System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

版本:1.43.68 2025-04-13 11:35 Microsoft Windows NT 10.0.26100.0
报错信息 2
InvalidOperationException: Attempted to use WebView2 functionality which requires its CoreWebView2 prior to the CoreWebView2 being initialized.  Call EnsureCoreWebView2Async or set the Source property first.
StackTrace:
   在 Microsoft.Web.WebView2.Wpf.WebView2Base.VerifyCoreWebView2()
   在 Microsoft.Web.WebView2.Wpf.WebView2Base.NavigateToString(String htmlContent)
   在 DynamicClass.UpdatePreview()
   在 Microsoft.Web.WebView2.Wpf.WebView2Base.<>c__DisplayClass32_0.<<EnsureCoreWebView2Async>g__Init|0>d.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 DynamicClass.<MarkdownEditor_TextChanged>d__2.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

版本:1.43.68 2025-04-05 18:16 Microsoft Windows NT 10.0.26100.0