Skip to content

Enable TreatWarningsAsErrors repo-wide and fix 191 build warnings #113

@mattleibow

Description

@mattleibow

Summary

The solution currently produces 191 build warnings. We should enable TreatWarningsAsErrors in Directory.Build.props and fix or suppress these warnings to prevent regressions.

DeviceRunners.VisualRunners.Core already has TreatWarningsAsErrors=true (added in PR #111).

Warning Breakdown

Project Count Warnings
DeviceRunners.VisualRunners.Maui ~143 XamlC XC0022 — uncompiled bindings (add x:DataType to XAML)
DeviceRunners.VisualRunners 34 CS8602 (null deref ×14), CS8769 (nullability mismatch ×12), CS8622 (nullability delegate ×6), CS8603 (possible null return ×2)
DeviceTestingKitApp.DeviceTests 8 Xamarin.Shared.Sdk PublishFolderType metadata warnings, CS8892 (dual entry point)
DeviceRunners.Cli 4 NU1510 — unnecessary System.Security.Cryptography.X509Certificates PackageReference
DeviceRunners.slnx 2 NU1510

Suggested Approach

  1. Fix the 34 nullability warnings in DeviceRunners.VisualRunners
  2. Add x:DataType to XAML bindings in DeviceRunners.VisualRunners.Maui (or suppress XC0022)
  3. Remove unnecessary System.Security.Cryptography.X509Certificates package from CLI
  4. Address sample project warnings
  5. Enable <TreatWarningsAsErrors>true</TreatWarningsAsErrors> in Directory.Build.props

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions