diff --git a/tests/CodeBehind/BuildTests/Properties/AssemblyInfo.cs b/tests/CodeBehind/BuildTests/Properties/AssemblyInfo.cs index 9c50308b3c6..4b991ef195c 100644 --- a/tests/CodeBehind/BuildTests/Properties/AssemblyInfo.cs +++ b/tests/CodeBehind/BuildTests/Properties/AssemblyInfo.cs @@ -1,7 +1,14 @@ using System.Reflection; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using Android.App; +// This assembly only ever runs on Android (minimum API level 24). Without this +// attribute the platform-compatibility analyzer treats the assembly as platform-neutral +// (because GenerateAssemblyInfo is disabled) and emits spurious CA1416 warnings for every +// call to an [SupportedOSPlatform("android24.0")] API. +[assembly: SupportedOSPlatform ("android24.0")] + // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. diff --git a/tests/Mono.Android-Tests/Mono.Android-Tests/Properties/AssemblyInfo.cs b/tests/Mono.Android-Tests/Mono.Android-Tests/Properties/AssemblyInfo.cs index dbb0cde4889..087e2bdec67 100644 --- a/tests/Mono.Android-Tests/Mono.Android-Tests/Properties/AssemblyInfo.cs +++ b/tests/Mono.Android-Tests/Mono.Android-Tests/Properties/AssemblyInfo.cs @@ -1,7 +1,14 @@ using System.Reflection; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using Android.App; +// This test assembly only ever runs on Android (minimum API level 24). Without this +// attribute the platform-compatibility analyzer treats the assembly as platform-neutral +// (because GenerateAssemblyInfo is disabled) and emits spurious CA1416 warnings for every +// call to an [SupportedOSPlatform("android24.0")] API. +[assembly: SupportedOSPlatform ("android24.0")] + // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. diff --git a/tests/TestRunner.Core/Properties/AssemblyInfo.cs b/tests/TestRunner.Core/Properties/AssemblyInfo.cs index f03603e4cd2..92913128458 100644 --- a/tests/TestRunner.Core/Properties/AssemblyInfo.cs +++ b/tests/TestRunner.Core/Properties/AssemblyInfo.cs @@ -1,7 +1,14 @@ using System.Reflection; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using Android.App; +// This assembly only ever runs on Android (minimum API level 24). Without this +// attribute the platform-compatibility analyzer treats the assembly as platform-neutral +// (because GenerateAssemblyInfo is disabled) and emits spurious CA1416 warnings for every +// call to an [SupportedOSPlatform("android24.0")] API. +[assembly: SupportedOSPlatform ("android24.0")] + // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project.