Skip to content

Can't build a project using WinAppSDK and latest C++/winrt when in C++20 mode "IComponentConnector2 identifier not found" #1155

@mikrause79

Description

@mikrause79

Compiler error "IComponentConnector2 identifier not found" in winrt/Microsoft.UI.Xaml.Markup.h.

This generated code:
static constexpr bool m_has_connectable_base{
impl::has_initializer<composable_base>::value &&
impl::has_interface<D, IComponentConnector>() &&
impl::has_interface<D, IComponentConnector2>() };

IComponentConnector2 doesn't exist - it was folded into IComponentConnector in WinUI. this doesn't generate an error in C++17 mode, but does in C++20.

Rolling back to the previous C++/winrt doesn't generate this error.

This is with latest non-preview (as of 6/5) Visual Studio, WinApp SDK 1.0, and C++/WinRT 531
Visual Studio 17.2.3
C++/Winrt 2.0.220531.1
Windows App SDK 1.0

Steps to reproduce the bug
Create a WinAppSDK WinUI 3 Desktop project - no changes from template.
Build - confirm no errors.
Switch to C++20 mode in Language options in MSVC
Rebuild
Expected behavior
Builds without issue.

Actual behavior:
Error, "IComponentConnector2 identifier not found"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions