.NET 10: PlatformCompatibilityAnalyzer not working #7525
Open
Description
Analyzer
Diagnostic ID: CA1416: Validate platform compatibility
Analyzer source
Describe the bug
For Android, we have an API such as:
[SupportedOSPlatform("android22.0")]
public virtual int AccessibilityTraversalAfter { get; set; }
Using the API with SupportedOSPlatformVersion=21.0
does not result in a CA1416
warning.
We first noticed this here, getting the Android workload on a .NET 10 SDK:
In the following integration test:
Steps To Reproduce
dotnet new android
- Use
button.AccessibilityTraversalAfter
- Observe no warnings
Here is a .binlog
if that is helpful: supportedosplatformversion.zip
Expected behavior
Using the API with SupportedOSPlatformVersion=21.0
results in a CA1416
warning.
Actual behavior
Using the API with SupportedOSPlatformVersion=21.0
does not result in a CA1416
warning.
Additional context
I'm guessing the code here would not work as expected for TargetFramework=net10.0
, as it has 1 more digit:
Metadata
Assignees
Labels
No labels