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
- Fix the 34 nullability warnings in
DeviceRunners.VisualRunners
- Add
x:DataType to XAML bindings in DeviceRunners.VisualRunners.Maui (or suppress XC0022)
- Remove unnecessary
System.Security.Cryptography.X509Certificates package from CLI
- Address sample project warnings
- Enable
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> in Directory.Build.props
Summary
The solution currently produces 191 build warnings. We should enable
TreatWarningsAsErrorsinDirectory.Build.propsand fix or suppress these warnings to prevent regressions.DeviceRunners.VisualRunners.Corealready hasTreatWarningsAsErrors=true(added in PR #111).Warning Breakdown
x:DataTypeto XAML)PublishFolderTypemetadata warnings, CS8892 (dual entry point)System.Security.Cryptography.X509CertificatesPackageReferenceSuggested Approach
DeviceRunners.VisualRunnersx:DataTypeto XAML bindings inDeviceRunners.VisualRunners.Maui(or suppress XC0022)System.Security.Cryptography.X509Certificatespackage from CLI<TreatWarningsAsErrors>true</TreatWarningsAsErrors>inDirectory.Build.props