Skip to content

[Bug]: XAML diagnostics miss many constructs that fail the build or crash at runtime #357

Open

Description

Describe the bug

No diagnostic is produced for these (tracking issue for false negatives):

  • Missing x:Key in a resource dictionary
  • WPF-only markup: {DynamicResource}, {x:Static}, {x:Type} (also offered in completion)
  • Abstract or non-constructible elements (<UIElement/>, <Panel/>)
  • x:Name and Name on the same element
  • Unknown Style TargetType, text in non-content panels, double assignment, x:Load without x:Name, Click="", TwoWay binding to a read-only property
  • ResourceDictionary Source= pointing to a missing file (throws at runtime)
  • Style.BasedOn cycles, self-reference, and incompatible TargetType (WMC0145)
  • {StaticResource} of the wrong value type (e.g. a brush used for Spacing)
  • x:Bind to a method without parentheses (WMC1121)

To Reproduce

  1. Add any construct above to a page, e.g. <Style TargetType="Nope"/> or <ResourceDictionary Source="ms-appx:///Styles/DoesNotExist.xaml"/>.
  2. No diagnostic is shown; dotnet build fails or the page throws at runtime.

Expected behavior

A diagnostic at the offending node for each case.

Notes

Related: #203. Bug bash IDs: C-18, C-20, C-21, C-42 (diagnostic part), C-47 (method part).

Screenshots

No response

OS Version and details

Windows 11 x64 (10.0.26200), VS Code 1.143.1, .NET SDK 10.0.403. Found in the XAML IntelliSense bug bash on 0.3.1-prerelease.456 (PR #276, f90df977).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions