Skip to content

Bug:Build failure due to namespace changes in XamlTypeInfo after C++/WinRT update #9471

@takatsuka2022

Description

@takatsuka2022

Describe the bug

In cppwinrt version 2.0.240111.5

I'm experiencing a build failure when referencing a WinUI 3 runtime component (root namespace: Control1) in a WinUI 3 project (root namespace: App1). The namespaces registered in App1's XamlTypeInfo are different before and after updating C++/WinRT.

Before the update, the entry in XamlTypeInfo looks like this:

L"Control1.UserControl1", L"",
&ActivateType<::winrt::Control1::UserControl1>, nullptr, nullptr, nullptr,
121, // Microsoft.UI.Xaml.Controls.UserControl
85, 0, -1, TypeKind::Metadata,
TypeInfo_Flags_None,
-1,

After the update, it changes to:

L"Control1.UserControl1", L"",
&ActivateLocalType<::winrt::Control1::implementation::UserControl1>, nullptr, nullptr, nullptr,
121, // Microsoft.UI.Xaml.Controls.UserControl
85, 0, -1, TypeKind::Custom,
TypeInfo_Flags_IsLocalType | TypeInfo_Flags_None,
-1,

Steps to reproduce the bug

I'm experiencing a build failure when referencing a WinUI 3 runtime component (root namespace: Control1) in a WinUI 3 project (root namespace: App1).

Expected behavior

No response

Screenshots

No response

NuGet package version

None

Windows version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingteam-MarkupIssue for the Markup team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions