Skip to content

[Problem/Bug]: Using wv2winrt results in the project's .winmd file being modified on every compilation (triggering rebuilds of dependent projects) #5567

@amtopel

Description

@amtopel

What happened?

In my C++/WinRT non-packaged WinUI3 project, I have a UserControl that hosts a WebView2 control. I've enabled use of the wv2winrt tool (via the Project Properties menu) in order to create a WinRTAdapter::DispatchAdapter for wrapping the host control and passing it to CoreWebView2::AddHostObjectToScript.

Everything compiles and runs properly, but I noticed that even small changes to this project's code were triggering rebuilds of other projects that have references to it. So I ran builds with diagnostic verbosity, and it appears that the wv2winrt tool always causes the project's .winmd output to be modified, which causes other dependent projects to rebuild. This occurs even if my project's .idl interfaces remain unchanged.

Importance

Low. My app is not very affected, or this only affects development.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

147.0.3912.72

SDK Version

1.0.3912.50

Framework

WinUI3/WinAppSDK

Operating System

Windows 11

OS Version

10.0.26200 Build 26200

Repro steps

Create a new project C++/WinRT WinUI desktop component > Right click for Properties > Common Properties > WebView2 > Use the wv2winrt tool - Yes (and add Namespace.Classname to Include filters).

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