[Problem/Bug]: Webview2CompositionControl throws NRE on load in Outlook COM add-in
What happened?
I want to use a Webview2CompositionControl in WPF element in an Outlook COM add-in
When the control is loaded, the on_loaded method throws a NullReferenceException.
This seems to originate to the point where the on_loaded method calls Window.getWindow(this).LocationChanged += WebView2CompositionControl_LocationChanged; triggered byEnsureCoreWebView2Async(), but Window.getWindow(this) returns null.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
No response
SDK Version
No response
Framework
WPF
Operating System
Windows 11
OS Version
No response
Repro steps
instantiate a Webview2CompositionControl in an Explorer or Inspector window in Outlook
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
I am having the same problem in a multi-process WPF application. I tried creating a temporary host window and assigning its content to the control, but that just resulted in a further problem where the process main window handle was 0 during D3D initialisation.
Hi @martijnhoekstra can you please provide the SDK version and all the related details , that would be helpful . Thankyou.
I have the problem with just a WebView2CompositionControl in a double-nested TabControl, pure WPF.