Skip to content

XamlC error XC0000 when using VisualState on custom control #31186

@APopatanasov

Description

@APopatanasov

Description

I have a custom control with a VisualState defined in XAML. When XamlC runs during compilation, it throws the following error: XamlC error XC0000: Cannot resolve type "http://schemas.microsoft.com/dotnet/2021/maui:MyButton"

Steps to Reproduce

  1. Create a custom control named MyButton that inherits from Button.
  2. Declare the XML namespace (xmlns) for MyButton in your XAML file.
  3. Use MyButton in XAML and define a VisualState for it.
  4. Build the project.

Link to public reproduction project repository

https://github.com/telerik/ms-samples/tree/main/Maui/XamlCNet10Preview7Issue

Version with bug

10.0.0-preview.7

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

10.0.0-preview.6

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions