Inheriting from WinUI 2 Control in C++/WinRT results in compile issues
See original GitHub issueDescribe the bug
When inheriting from a MUXC control in MIDL, the compilation fails with errors like this:
Severity Code Description File Project Line Suppression State
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_VerticalCacheLength' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_VerticalCacheLength' ( Procedure 'put_VerticalCacheLength' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_Layout' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_Layout' ( Procedure 'put_Layout' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_ItemTemplate' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_ItemTemplate' ( Procedure 'put_ItemTemplate' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_ItemsSource' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_ItemsSource' ( Procedure 'put_ItemsSource' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_HorizontalCacheLength' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_HorizontalCacheLength' ( Procedure 'put_HorizontalCacheLength' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_Animator' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'put_Animator' ( Procedure 'put_Animator' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_VerticalCacheLength' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_VerticalCacheLength' ( Procedure 'get_VerticalCacheLength' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_Layout' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_Layout' ( Procedure 'get_Layout' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_ItemTemplate' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_ItemTemplate' ( Procedure 'get_ItemTemplate' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_ItemsSource' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_ItemsSource' ( Procedure 'get_ItemsSource' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_HorizontalCacheLength' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_HorizontalCacheLength' ( Procedure 'get_HorizontalCacheLength' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_Animator' ( RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL5015 [msg]the custom attribute argument contains a boolean value that is not valid [context]: enable [ Procedure 'get_Animator' ( Procedure 'get_Animator' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL2072 [msg]inapplicable attribute [context]: Windows.Foundation.Metadata.ExperimentalAttribute [ RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ( RuntimeClass 'RepeaterCompileCrash.BlankUserControl' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Error MIDL2072 [msg]inapplicable attribute [context]: Windows.Foundation.Metadata.ExperimentalAttribute [ RuntimeClass 'Microsoft.UI.Xaml.Controls.ItemsRepeater' ( RuntimeClass 'RepeaterCompileCrash.BlankUserControl' ) ] D:\Projects\RepeaterCompileCrash\BlankUserControl.idl RepeaterCompileCrash 5
Steps to reproduce the bug
Steps to reproduce the behavior:
- Create new C++/WinRT project
- Add WinUI package and update pch.h
- Create new control, inherit from a MUXC control in IDL
- Compile project
Expected behavior
Project should compile just fine.
Screenshots
Version Info
NuGet package version:
Microsoft.UI.Xaml.2.5.0-prerelease.200923002
Windows 10 version | Saw the problem? |
---|---|
Insider Build (20241) | Yes |
May 2020 Update (19041) | |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | |
Xbox | |
Surface Hub | |
IoT |
Additional context
Issue found by @sylveon
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:25 (21 by maintainers)
Top Results From Across the Web
Data binding in depth - UWP applications
The binding <TextBlock Text="{x:Bind SampleDataGroupAsObject.Title}"/> will result in a compile error because the Title property is not found on ...
Read more >Inheriting descendant of WinUI-UserControl does not ...
Inheriting descendant of WinUI-UserControl does not inherit all styles · Inheriting as above results in certain styles missing; · Copying the ...
Read more >Differences between Uno.UI and UWP/WinUI
As for WinUI, all visual elements in Uno.UI inherit from FrameworkElement , which inherits from UIElement . (At least, those that are publicly...
Read more >Delphi WinUI 3 Demo
The demo comes with updated versions of the WinRT Delphi RTL import units, to support the 1.0 release of WinUI 3. The current...
Read more >If you're not having fun, you're doing it wrong. | Page 2
In this article we take a look at multi-windowing in a WinUI 3 Desktop application. The ability for an app to control multiple...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Terminal just hit this attempting to add a MUX type as a member to an idl.
(/cc @carlos-zamora)
Filed https://task.ms/33886151