ReSharper 2020.1 Help

Code Inspections in XAML

In XAML, ReSharper 2020.1 provides two kinds of code inspections: 18 inspections that detect errors such as broken syntax, unresolved symbols, compiler errors, and so on (you cannot configure or disable any of these inspections), and 55 proprietary code inspections, any of which you can disable or change its severity level.
These code inspections help you detect code issues in design time in all open files, and additionally they allow you to find code issues in specific scope.

Configurable XAML inspections are listed below, grouped by their categories.

Code Notification (14 inspections)

This category groups code inspections with minor severity levels.
InspectionIDEditorConfig propertyDefault severity
{DynamicResource} can only be used with dependency propertyXaml.DynamicResourceErrorresharper_xaml_dynamic_resource_error_highlightingError
Constructor not resolvedXaml.ConstructorWarningresharper_xaml_constructor_warning_highlightingWarning
Dependency property descriptor field missingXaml.DependencyPropertyResolveErrorresharper_xaml_dependency_property_resolve_error_highlightingWarning
Element name reference not resolvedXaml.ElementNameReferenceNotResolvedresharper_xaml_element_name_reference_not_resolved_highlightingError
Ignored pathXaml.IgnoredPathHighlightingresharper_xaml_ignored_path_highlighting_highlightingDisabled
Mapped pathXaml.MappedPathHighlightingresharper_xaml_mapped_path_highlighting_highlightingHint
Member of invalid typeXaml.InvalidMemberTyperesharper_xaml_invalid_member_type_highlightingError
Object/markup extension of invalid typeXaml.InvalidTyperesharper_xaml_invalid_type_highlightingError
Routed event descriptor field missingXaml.RoutedEventResolveErrorresharper_xaml_routed_event_resolve_error_highlightingWarning
Static resource not resolvedXaml.StaticResourceNotResolvedresharper_xaml_static_resource_not_resolved_highlightingWarning
Unresolved binding path when DataContext is knownXaml.BindingWithContextNotResolvedresharper_xaml_binding_with_context_not_resolved_highlightingWarning
Unresolved binding path when DataContext is unknownXaml.BindingWithoutContextNotResolvedresharper_xaml_binding_without_context_not_resolved_highlightingHint
XAML resource of invalid typeXaml.InvalidResourceTyperesharper_xaml_invalid_resource_type_highlightingError
XAML style of invalid target typeXaml.InvalidResourceTargetTyperesharper_xaml_invalid_resource_target_type_highlightingError

Common Practices and Code Improvements (3 inspections)

This category groups inspections that hunt for medium severity issues that mainly affect code readability.
InspectionIDEditorConfig propertyDefault severity
Member can be made private (non-private accessibility)MemberCanBePrivate.Globalresharper_member_can_be_private_global_highlightingSuggestion
Member can be made protected (non-private accessibility)MemberCanBeProtected.Globalresharper_member_can_be_protected_global_highlightingSuggestion
Member or type can be made internal(friend)MemberCanBeInternalresharper_member_can_be_internal_highlightingDisabled

Compiler Warnings (2 inspections)

Inspections in this category detect compiler warnings before you compile.
InspectionIDEditorConfig propertyDefault severity
Use of obsolete type or type memberObsoleteElementresharper_obsolete_element_highlightingWarning
Use of obsolete type or type member (error)ObsoleteElementErrorresharper_obsolete_element_error_highlightingError

Constraints Violations (1 inspection)

This category includes code inspections, mostly with the warning severity level, which detect violations related to symbol attributes, including ReSharper's code annotations, and other similar issues.
InspectionIDEditorConfig propertyDefault severity
Inconsistent NamingInconsistentNamingresharper_inconsistent_naming_highlightingWarning

Potential Code Quality Issues (16 inspections)

This category includes inspections that detect critical issues (code smells), mostly with Error or Warning level. This category also includes inspections that ensure localization assistance.
InspectionIDEditorConfig propertyDefault severity
DeviceFamily-specific view type name does not match generic type nameXaml.XamlMismatchedDeviceFamilyViewClrNameHighlightingresharper_xaml_xaml_mismatched_device_family_view_clr_name_highlighting_highlightingWarning
Duplicate device family viewXaml.XamlDuplicateDeviceFamilyTypeViewHighlightingresharper_xaml_xaml_duplicate_device_family_type_view_highlighting_highlightingError
Duplicate style property/event setterXaml.DuplicateStyleSetterresharper_xaml_duplicate_style_setter_highlightingWarning
Grid element column/row index is out of grid definition rangeXaml.IndexOutOfGridDefinitionresharper_xaml_index_out_of_grid_definition_highlightingWarning
Missing grid column/row setter for non-first childXaml.MissingGridIndexresharper_xaml_missing_grid_index_highlightingWarning
Non-accessed field (non-private accessibility)NotAccessedField.Globalresharper_not_accessed_field_global_highlightingSuggestion
Non-accessed field (private accessibility)NotAccessedField.Localresharper_not_accessed_field_local_highlightingWarning
Path errorXaml.PathErrorresharper_xaml_path_error_highlightingWarning
RelativeSourceMode is not set explicitlyXaml.XamlRelativeSourceDefaultModeWarningHighlightingresharper_xaml_xaml_relative_source_default_mode_warning_highlighting_highlightingWarning
Resource cannot be accessed by class name because of x:Key attributeXaml.RedundantXamarinFormsClassDeclarationresharper_xaml_redundant_xamarin_forms_class_declaration_highlightingWarning
Style target type is not convertible to base typeXaml.StyleInvalidTargetTyperesharper_xaml_style_invalid_target_type_highlightingError
Types in x:DataType and BindingContext mismatchXaml.XamlXamarinFormsDataTypeAndBindingContextTypeMismatchedHighlightingresharper_xaml_xaml_xamarin_forms_data_type_and_binding_context_type_mismatched_highlighting_highlightingWarning
Unexpected text token errorXaml.UnexpectedTextTokenresharper_xaml_unexpected_text_token_highlightingError
Unknown DeviceFamilyXaml.XamlUnknownDeviceFamilyTypeHighlightingresharper_xaml_xaml_unknown_device_family_type_highlighting_highlightingWarning
x:Key is allowed for resources and dictionary elements onlyXaml.XKeyAttributeDisallowedresharper_xaml_x_key_attribute_disallowed_highlightingError
XAML language level errorXaml.LanguageLevelresharper_xaml_language_level_highlightingError

Redundancies in Code (11 inspections)

Code inspections in this category look for redundancies and dead code, which affect code readability and style, and could be safely removed. Some code redundancies cannot be fixed automatically, and quick-fixes for them are performed in the interactive mode, requiring the user input. But the majority of the redundancies can be fixed without user interaction, using either fix in scope or code cleanup.
InspectionIDEditorConfig propertyDefault severity
Property value is equal to style-providedXaml.RedundantStyledValueresharper_xaml_redundant_styled_value_highlightingWarning
Redundant empty collection property setterXaml.RedundantCollectionPropertyresharper_xaml_redundant_collection_property_highlightingWarning
Redundant 'Freeze' attributeXaml.RedundantFreezeAttributeresharper_xaml_redundant_freeze_attribute_highlightingWarning
Redundant modifiers attributeXaml.RedundantModifiersAttributeresharper_xaml_redundant_modifiers_attribute_highlightingWarning
Redundant name attributeXaml.RedundantNameAttributeresharper_xaml_redundant_name_attribute_highlightingWarning
Redundant namespace aliasXaml.RedundantNamespaceAliasresharper_xaml_redundant_namespace_alias_highlightingWarning
Redundant property type qualifierXaml.RedundantPropertyTypeQualifierresharper_xaml_redundant_property_type_qualifier_highlightingWarning
Redundant resourceXaml.RedundantResourceresharper_xaml_redundant_resource_highlightingWarning
Remove redundant attached property setterXaml.RedundantAttachedPropertyresharper_xaml_redundant_attached_property_highlightingWarning
Single grid row/column definition is redundantXaml.RedundantGridDefinitionsresharper_xaml_redundant_grid_definitions_highlightingWarning
Single-cell grid column/row span is redundantXaml.RedundantGridSpanresharper_xaml_redundant_grid_span_highlightingWarning

Redundancies in Symbol Declarations (4 inspections)

This category includes code inspections, mostly with the warning severity level, which detect empty and unused symbol declarations.
InspectionIDEditorConfig propertyDefault severity
Type is never used (non-private accessibility)UnusedType.Globalresharper_unused_type_global_highlightingSuggestion
Type is never used (private accessibility)UnusedType.Localresharper_unused_type_local_highlightingWarning
Type member is never used (non-private accessibility)UnusedMember.Globalresharper_unused_member_global_highlightingSuggestion
Type member is never used (private accessibility)UnusedMember.Localresharper_unused_member_local_highlightingWarning

Spelling issues (4 inspections)

These inspections detect typos in various contexts.
InspectionIDEditorConfig propertyDefault severity
Typo in commentCommentTyporesharper_comment_typo_highlightingSuggestion
Typo in identifierIdentifierTyporesharper_identifier_typo_highlightingSuggestion
Typo in markup attribute valueMarkupAttributeTyporesharper_markup_attribute_typo_highlightingSuggestion
Typo in markup textMarkupTextTyporesharper_markup_text_typo_highlightingSuggestion
Last modified: 15 July 2020