From 09f075fff71e8ca0c910d19419a0af8a1179840b Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Tue, 30 Mar 2021 21:41:14 -0700 Subject: [PATCH] Resolve unknown platform name warnings (#50193) * Add targets as supported platforms * Update analyzer version * Update comment, remove '' != 'false' condition --- eng/Versions.props | 2 +- eng/targetframeworksuffix.props | 2 ++ eng/versioning.targets | 20 ++++++++++++++----- .../Diagnostics/Tracing/CounterGroup.cs | 2 ++ .../Diagnostics/Tracing/DiagnosticCounter.cs | 2 ++ .../Diagnostics/Tracing/EventCounter.cs | 2 ++ 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 12105014900..2e3ff3518a2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -45,7 +45,7 @@ - 6.0.0-preview3.21158.1 + 6.0.0-preview3.21168.1 3.9.0-5.final 3.9.0-5.final diff --git a/eng/targetframeworksuffix.props b/eng/targetframeworksuffix.props index 5926e5266de..00d2acfd460 100644 --- a/eng/targetframeworksuffix.props +++ b/eng/targetframeworksuffix.props @@ -9,6 +9,8 @@ $(TargetFrameworkSuffix) 1.0 $(TargetFrameworkSuffix),Version=$(TargetPlatformVersion) + + 0.0 diff --git a/eng/versioning.targets b/eng/versioning.targets index a55fe2407ec..cf0f497a109 100644 --- a/eng/versioning.targets +++ b/eng/versioning.targets @@ -47,17 +47,27 @@ - - - - + + + + + + + <_unsupportedOSPlatforms Include="$(UnsupportedOSPlatforms)" /> - + + <_Parameter1>%(_unsupportedOSPlatforms.Identity) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs index 10da258166b..5d85b20e7b6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs @@ -15,7 +15,9 @@ namespace Microsoft.Diagnostics.Tracing namespace System.Diagnostics.Tracing #endif { +#if NETCOREAPP [UnsupportedOSPlatform("browser")] +#endif internal sealed class CounterGroup { private readonly EventSource _eventSource; diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/DiagnosticCounter.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/DiagnosticCounter.cs index 16724c371c4..0c23cf99222 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/DiagnosticCounter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/DiagnosticCounter.cs @@ -20,7 +20,9 @@ namespace System.Diagnostics.Tracing /// DiagnosticCounter is an abstract class that serves as the parent class for various Counter* classes, /// namely EventCounter, PollingCounter, IncrementingEventCounter, and IncrementingPollingCounter. /// +#if NETCOREAPP [UnsupportedOSPlatform("browser")] +#endif public abstract class DiagnosticCounter : IDisposable { /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventCounter.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventCounter.cs index 52dac797398..8a53d569082 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventCounter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventCounter.cs @@ -24,7 +24,9 @@ namespace System.Diagnostics.Tracing /// See https://github.com/dotnet/runtime/blob/main/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs /// which shows tests, which are also useful in seeing actual use. /// +#if NETCOREAPP [UnsupportedOSPlatform("browser")] +#endif public partial class EventCounter : DiagnosticCounter { /// -- GitLab