Skip to content

Is C++ Windows Runtime Component (WinUI3) usable in WinUI3 Desktop Packaged project? #763

Answered by DefaultRyan
hereafter asked this question in Q&A
Discussion options

You must be logged in to vote

The Xaml Compiler knows enough about the project reference to add a reference to the runtime component's XamlMetaDataProvider:

    if (_otherProviders.empty())
    {
        _otherProviders.push_back(::winrt::Controls1::XamlMetaDataProvider());
        _otherProviders.push_back(::winrt::Microsoft::UI::Xaml::XamlTypeInfo::XamlControlsXamlMetaDataProvider());
    }

Unfortunately, it didn't add the needed #include statement to that file. I've filed an issue with WinUI to track this:

XamlTypeInfo.g.cpp adds providers for project references, but doesn't #include needed headers
In the meantime, you c…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@DefaultRyan
Comment options

Comment options

You must be logged in to vote
1 reply
@hereafter
Comment options

Answer selected by hereafter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants