Skip to content

[Problem/Bug]: Webview2CompositionControl throws NRE on load in Outlook COM add-in #5316

@martijnhoekstra

Description

@martijnhoekstra

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions