Description
Visual Studio 2017 Designer Crashes everytime when open a WinForms which contains WebView2 Control.
The error message seems like there is a DLL not Found, but which DLL? It's not clear which DLLs VisualStudio needs at DesignTime. Compile and run this code works perfectly.
In ProcessMonitor i had no chance to identify which DLL is should be.
If I Remove all WebView2 Element from my project and add it again, it works for a week or two.
But then I have to remove it again. It's frustrating since it needs hours to do...
In Event Log there is following Message:
Anwendung: devenv.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.DllNotFoundException
bei Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2EnvironmentWithOptions(System.String, System.String, Microsoft.Web.WebView2.Core.Raw.ICoreWebView2EnvironmentOptions, Microsoft.Web.WebView2.Core.Raw.ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler)
bei Microsoft.Web.WebView2.Core.CoreWebView2Environment+d__3.MoveNext()
Ausnahmeinformationen: System.AggregateException
bei System.Threading.Tasks.Task.WaitAll(System.Threading.Tasks.Task[], Int32, System.Threading.CancellationToken)
bei WebView2Test.WebView2Helper.InitializeWebView2Env()
bei WebView2Test.WebView2Helper+d__4.MoveNext()
bei System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0(System.Object)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
bei System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
bei MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
bei System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
bei MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
bei System.Windows.Threading.DispatcherOperation.Invoke()
bei System.Windows.Threading.Dispatcher.ProcessQueue()
bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
bei MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
Version
SDK: 1.0.705.50
Runtime: Microsoft.WebView2.FixedVersionRuntime.88.0.705.68.x64
Framework: WinForms based on .NET 5.6.1
OS: Win10 20H2
Repro Steps
Dont't know since it's not a problem in all project. It appears with no reason.
AB#44876576
Description
Visual Studio 2017 Designer Crashes everytime when open a WinForms which contains WebView2 Control.
The error message seems like there is a DLL not Found, but which DLL? It's not clear which DLLs VisualStudio needs at DesignTime. Compile and run this code works perfectly.
In ProcessMonitor i had no chance to identify which DLL is should be.
If I Remove all WebView2 Element from my project and add it again, it works for a week or two.
But then I have to remove it again. It's frustrating since it needs hours to do...
In Event Log there is following Message:
Anwendung: devenv.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.DllNotFoundException
bei Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2EnvironmentWithOptions(System.String, System.String, Microsoft.Web.WebView2.Core.Raw.ICoreWebView2EnvironmentOptions, Microsoft.Web.WebView2.Core.Raw.ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler)
bei Microsoft.Web.WebView2.Core.CoreWebView2Environment+d__3.MoveNext()
Ausnahmeinformationen: System.AggregateException
bei System.Threading.Tasks.Task.WaitAll(System.Threading.Tasks.Task[], Int32, System.Threading.CancellationToken)
bei WebView2Test.WebView2Helper.InitializeWebView2Env()
bei WebView2Test.WebView2Helper+d__4.MoveNext()
bei System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0(System.Object)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
bei System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
bei MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
bei System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
bei MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
bei System.Windows.Threading.DispatcherOperation.Invoke()
bei System.Windows.Threading.Dispatcher.ProcessQueue()
bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
bei MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
Version
SDK: 1.0.705.50
Runtime: Microsoft.WebView2.FixedVersionRuntime.88.0.705.68.x64
Framework: WinForms based on .NET 5.6.1
OS: Win10 20H2
Repro Steps
Dont't know since it's not a problem in all project. It appears with no reason.
AB#44876576