Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WInUI] XLS0503 and WMC0020 errors occur when added the "Blank Window (WinUI 3 in Desktop)" into the MainWindow #10123

Closed
XamlTest opened this issue Oct 30, 2024 · 3 comments
Labels
closed-ByDesign Described behavior is by design.

Comments

@XamlTest
Copy link

XamlTest commented Oct 30, 2024

Describe the bug

When added the "Blank Window (WinUI 3 in Desktop)" item into the MainWindow.xaml. The XLS0503 and WMC0020 errors occur.

Steps to reproduce the bug

Affected Branch: main
Affected Build: 35422.220

1.Create a C# Blank App, Package (WinUI3 in Desktop) project.
2.Right-click the Project name (Desktop) project node in Solution Explorer and select Add -> New Item.
3. In the Add New Item dialog box, select the WinUI tab, choose the "Blank Window (WinUI 3 in Desktop)" to add, and then click Add.
4.Build your solution
5.Add the new item created in step3 into MainWindow.xaml
Image
6.Press F5

Expected behavior

The project should be built successfully.

Screenshots

Actual Result:
The project is built failed with XLS0503 & WMC0020 errors.
XLS0503: A value of type 'BlankWindow1' cannot be added to a collection or dictionary of type 'UIElementCollection'.
WMC0020: Cannot add 'BlankWindow1' into the collection property 'Children', type must be 'UIElement'

Image

NuGet package version

None

Packaging type

No response

Windows version

No response

IDE

No response

Additional context

  1. This issue also repro on 17.6.21 p1 [35426.19.d17.6]
  2. This issue is not repro on WPF Application project.
    Image
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Oct 30, 2024
@RDMacLachlan RDMacLachlan transferred this issue from microsoft/WindowsAppSDK Oct 31, 2024
@codendone
Copy link
Contributor

I think this is by design: Window in WinUI3 is not a FrameworkElement.

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@karkarl
Copy link
Contributor

karkarl commented Oct 31, 2024

Closing as it is by design.

@karkarl karkarl closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2024
@karkarl karkarl added closed-ByDesign Described behavior is by design. and removed needs-triage Issue needs to be triaged by the area owners labels Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-ByDesign Described behavior is by design.
Projects
None yet
Development

No branches or pull requests

3 participants