You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Diagnostic ID: CA1416: This call site is reachable on: 'iOS' 13.0 and later, 'maccatalyst' 13.0 and later, 'macOS/OSX' 15.0 and later. 'NSTextHighlightStyle.Default' is only supported on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'tvos' 18.0 and later
Problem only happens when building iOS project, but not when building macOS project
Also checking for OperatingSystem.IsIOS() resolves the problem if (OperatingSystem.IsIOS() && OperatingSystem.IsIOSVersionAtLeast(18) || OperatingSystem.IsMacOSVersionAtLeast(15))
Analyzer
Diagnostic ID: CA1416:
This call site is reachable on: 'iOS' 13.0 and later, 'maccatalyst' 13.0 and later, 'macOS/OSX' 15.0 and later. 'NSTextHighlightStyle.Default' is only supported on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'tvos' 18.0 and later
Analyzer source
SDK: Built-in CA analyzers in .NET 5 SDK or later
Version: SDK 9.0.200
Describe the bug
CA1416 is incorrectly reported
Steps To Reproduce
Solution with iOS, macOS and shared project.
This shared code is in the shared project:
Example project: test.zip
Expected behavior
No warning
Actual behavior
warning CA1416 is incorrectly reported
Additional context
Problem only happens when building iOS project, but not when building macOS project
Also checking for
OperatingSystem.IsIOS()
resolves the problemif (OperatingSystem.IsIOS() && OperatingSystem.IsIOSVersionAtLeast(18) || OperatingSystem.IsMacOSVersionAtLeast(15))
Possible duplicate of Unexpected CA1416 with multiple SupportedOSPlatformGuard attributes #7530
The text was updated successfully, but these errors were encountered: