From 5d702f87681f35cb019560075374346992bbde14 Mon Sep 17 00:00:00 2001 From: Buyaa Date: Fri, 16 Oct 2020 16:39:19 -0700 Subject: [PATCH] Fix new warnings (#43097) * Fix CA1416 warnings in runtime repo --- eng/Analyzers.props | 6 +++--- eng/Versions.props | 3 +++ eng/versioning.targets | 8 ++++---- .../src/Internal/Runtime/InteropServices/ComActivator.cs | 2 ++ .../src/System/Runtime/InteropServices/ComEventsInfo.cs | 3 +++ .../InteropServices/CustomMarshalers/ComDataHelpers.cs | 3 +++ .../CustomMarshalers/EnumerableToDispatchMarshaler.cs | 2 ++ .../CustomMarshalers/EnumerableViewOfDispatch.cs | 2 ++ .../CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs | 2 ++ .../src/System/RuntimeType.CoreCLR.cs | 1 + .../System/Threading/ClrThreadPoolBoundHandle.Windows.cs | 1 + .../src/System.Private.CoreLib/src/System/Variant.cs | 4 ++++ .../src/System.Private.CoreLib/src/System/__ComObject.cs | 2 ++ .../src/System/Runtime/InteropServices/ComEventsSink.cs | 2 ++ .../Common/src/System/Runtime/InteropServices/Variant.cs | 2 ++ ...icrosoft.Diagnostics.Tracing.EventSource.Redist.csproj | 1 + .../ref/Microsoft.VisualBasic.Core.cs | 1 + .../Microsoft/VisualBasic/CompilerServices/LateBinding.vb | 1 + .../src/Microsoft/VisualBasic/Interaction.vb | 1 + .../ref/System.DirectoryServices.Protocols.cs | 3 ++- .../Protocols/common/DirectoryControl.cs | 2 ++ .../InteropServices/StandardOleMarshalObject.Windows.cs | 3 +++ .../src/System.Runtime.Caching.csproj | 1 + .../ref/System.Runtime.InteropServices.cs | 1 + .../CompilerServices/IDispatchConstantAttribute.cs | 2 ++ .../System/Security/Cryptography/PasswordDeriveBytes.cs | 2 ++ .../src/System.ServiceModel.Syndication.csproj | 1 + .../src/System.Text.Encoding.CodePages.csproj | 1 + 28 files changed, 55 insertions(+), 8 deletions(-) diff --git a/eng/Analyzers.props b/eng/Analyzers.props index 17755195e00..4405ca11687 100644 --- a/eng/Analyzers.props +++ b/eng/Analyzers.props @@ -6,8 +6,8 @@ - - - + + + diff --git a/eng/Versions.props b/eng/Versions.props index b83e2dd249c..1a3373ee672 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -51,6 +51,8 @@ + 6.0.0-preview1.20513.4 + 3.8.0-4.20503.2 5.0.0-beta.20506.7 5.0.0-beta.20506.7 5.0.0-beta.20506.7 @@ -69,6 +71,7 @@ 5.0.0-preview.8.20359.4 + 1.2.0-beta.205 4.5.1 4.3.0 4.3.0 diff --git a/eng/versioning.targets b/eng/versioning.targets index efb7af48b76..61789747403 100644 --- a/eng/versioning.targets +++ b/eng/versioning.targets @@ -22,8 +22,8 @@ - - + + <_Parameter1>windows @@ -33,9 +33,9 @@ <_unsupportedOSPlatforms Include="$(UnsupportedOSPlatforms)" /> - + - + <_Parameter1>%(_unsupportedOSPlatforms.Identity) diff --git a/src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs b/src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs index 3a88bad3b1d..6caaede63b1 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs @@ -9,6 +9,7 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Runtime.Loader; +using System.Runtime.Versioning; // // Types in this file marked as 'public' are done so only to aid in @@ -108,6 +109,7 @@ public static unsafe ComActivationContext Create(ref ComActivationContextInterna } } + [SupportedOSPlatform("windows")] public static class ComActivator { #if FEATURE_COMINTEROP_UNMANAGED_ACTIVATION diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsInfo.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsInfo.cs index d8a0ea49e7d..ac434ad00d9 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsInfo.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsInfo.cs @@ -1,8 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; + namespace System.Runtime.InteropServices { + [SupportedOSPlatform("windows")] internal class ComEventsInfo { private ComEventsSink? _sinks; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/ComDataHelpers.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/ComDataHelpers.cs index e871eca7636..d0e230a6e56 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/ComDataHelpers.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/ComDataHelpers.cs @@ -1,10 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; + namespace System.Runtime.InteropServices.CustomMarshalers { internal static class ComDataHelpers { + [SupportedOSPlatform("windows")] public static TView GetOrCreateManagedViewFromComData(object comObject, Func createCallback) { object key = typeof(TView); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs index 10034bae86a..3bd63b33612 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; +using System.Runtime.Versioning; namespace System.Runtime.InteropServices.CustomMarshalers { + [SupportedOSPlatform("windows")] internal class EnumerableToDispatchMarshaler : ICustomMarshaler { private static readonly EnumerableToDispatchMarshaler s_enumerableToDispatchMarshaler = new EnumerableToDispatchMarshaler(); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs index 06f1f083ce2..a64da6919c2 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics; using System.Runtime.InteropServices.ComTypes; namespace System.Runtime.InteropServices.CustomMarshalers @@ -38,6 +39,7 @@ public System.Collections.IEnumerator GetEnumerator() IntPtr.Zero); } + Debug.Assert(OperatingSystem.IsWindows()); IntPtr enumVariantPtr = IntPtr.Zero; try { diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs index 61e65f833d8..b4718f5e7c2 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; +using System.Runtime.Versioning; using ComTypes = System.Runtime.InteropServices.ComTypes; namespace System.Runtime.InteropServices.CustomMarshalers { + [SupportedOSPlatform("windows")] internal class EnumeratorToEnumVariantMarshaler : ICustomMarshaler { private static readonly EnumeratorToEnumVariantMarshaler s_enumeratorToEnumVariantMarshaler = new EnumeratorToEnumVariantMarshaler(); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs index 85f2f68b6c2..b92ed244e5c 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs @@ -4234,6 +4234,7 @@ private static void WrapArgsForInvokeCall(object[] aArgs, int[] aArgsWrapperType aArgs[i] = new UnknownWrapper(aArgs[i]); break; case DispatchWrapperType.Dispatch: + Debug.Assert(OperatingSystem.IsWindows()); aArgs[i] = new DispatchWrapper(aArgs[i]); break; case DispatchWrapperType.Error: diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs index 595051fd216..097277e894d 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs @@ -16,6 +16,7 @@ private static ThreadPoolBoundHandle BindHandleCore(SafeHandle handle) try { + Debug.Assert(OperatingSystem.IsWindows()); // ThreadPool.BindHandle will always return true, otherwise, it throws. See the underlying FCall // implementation in ThreadPoolNative::CorBindIoCompletionCallback to see the implementation. bool succeeded = ThreadPool.BindHandle(handle); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Variant.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Variant.cs index 8ab1589db96..0ac65575793 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Variant.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Variant.cs @@ -279,6 +279,7 @@ public Variant(object? obj) else if (obj is DispatchWrapper) { vt = VarEnum.VT_DISPATCH; + Debug.Assert(OperatingSystem.IsWindows()); obj = ((DispatchWrapper)obj).WrappedObject; } else if (obj is ErrorWrapper) @@ -401,6 +402,7 @@ internal static void MarshalHelperCastVariant(object pValue, int vt, ref Variant switch (vt) { case 9: /*VT_DISPATCH*/ + Debug.Assert(OperatingSystem.IsWindows()); v = new Variant(new DispatchWrapper(pValue)); break; @@ -442,7 +444,9 @@ internal static void MarshalHelperCastVariant(object pValue, int vt, ref Variant 6 => /*VT_CY*/ new Variant(new CurrencyWrapper(iv.ToDecimal(provider))), 7 => /*VT_DATE*/ new Variant(iv.ToDateTime(provider)), 8 => /*VT_BSTR*/ new Variant(iv.ToString(provider)), +#pragma warning disable CA1416 // Validate platform compatibility 9 => /*VT_DISPATCH*/ new Variant(new DispatchWrapper((object)iv)), +#pragma warning restore CA1416 10 => /*VT_ERROR*/ new Variant(new ErrorWrapper(iv.ToInt32(provider))), 11 => /*VT_BOOL*/ new Variant(iv.ToBoolean(provider)), 12 => /*VT_VARIANT*/ new Variant((object)iv), diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/__ComObject.cs b/src/coreclr/src/System.Private.CoreLib/src/System/__ComObject.cs index 9015a016a7e..be3294ffdf6 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/__ComObject.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/__ComObject.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Runtime.InteropServices; using System.Reflection; +using System.Runtime.Versioning; namespace System { @@ -11,6 +12,7 @@ namespace System /// __ComObject is the root class for all COM wrappers. This class defines only /// the basics. This class is used for wrapping COM objects accessed from managed. /// + [SupportedOSPlatform("windows")] internal class __ComObject : MarshalByRefObject { private Hashtable? m_ObjectToDataMap; // Do not rename (runtime relies on this name). diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs b/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs index e9b6cd0370f..58bc43b0fd3 100644 --- a/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs +++ b/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs @@ -4,6 +4,7 @@ #nullable enable using System.Diagnostics; +using System.Runtime.Versioning; namespace System.Runtime.InteropServices { @@ -11,6 +12,7 @@ namespace System.Runtime.InteropServices /// Part of ComEventHelpers APIs which allow binding /// managed delegates to COM's connection point based events. /// + [SupportedOSPlatform("windows")] internal partial class ComEventsSink : IDispatch, ICustomQueryInterface { private Guid _iidSourceItf; diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/Variant.cs b/src/libraries/Common/src/System/Runtime/InteropServices/Variant.cs index f845179c510..6a36190e184 100644 --- a/src/libraries/Common/src/System/Runtime/InteropServices/Variant.cs +++ b/src/libraries/Common/src/System/Runtime/InteropServices/Variant.cs @@ -4,6 +4,7 @@ #nullable enable using System.Diagnostics; +using System.Runtime.Versioning; namespace System.Runtime.InteropServices { @@ -13,6 +14,7 @@ namespace System.Runtime.InteropServices /// to and from COM calls. /// [StructLayout(LayoutKind.Explicit)] + [SupportedOSPlatform("windows")] internal partial struct Variant { #if DEBUG diff --git a/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj b/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj index debefca0616..efc623ec5a2 100644 --- a/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj +++ b/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj @@ -5,6 +5,7 @@ net461-Windows_NT enable $(OutputPath)$(AssemblyName).xml + true true diff --git a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs index 922902e5d96..f9270fae1ee 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs @@ -496,6 +496,7 @@ public sealed partial class Interaction public static object? CallByName(object? ObjectRef, string ProcName, Microsoft.VisualBasic.CallType UseCallType, params object?[] Args) { throw null; } public static object? Choose(double Index, params object?[] Choice) { throw null; } public static string Command() { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object CreateObject(string ProgId, string? ServerName = "") { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void DeleteSetting(string AppName, string? Section = null, string? Key = null) { } diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/LateBinding.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/LateBinding.vb index 61fe5bc8ec2..b7b532e8eb3 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/LateBinding.vb +++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/LateBinding.vb @@ -266,6 +266,7 @@ Namespace Microsoft.VisualBasic.CompilerServices If UseCallType = CallType.Set Then flags = flags Or BindingFlags.PutRefDispProperty If args(args.GetUpperBound(0)) Is Nothing Then + Debug.Assert(OperatingSystem.IsWindows()) #Disable Warning BC40000 ' DispatchWrapper is marked obsolete. args(args.GetUpperBound(0)) = New DispatchWrapper(Nothing) #Enable Warning BC40000 diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Interaction.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Interaction.vb index bb3b41868d5..ec9ddddb4ca 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Interaction.vb @@ -494,6 +494,7 @@ Namespace Microsoft.VisualBasic End If End Sub + Public Function CreateObject(ByVal ProgId As String, Optional ByVal ServerName As String = "") As Object 'Creates local or remote COM2 objects. Should not be used to create COM+ objects. 'Applications that need to be STA should set STA either on their Sub Main via STAThreadAttribute diff --git a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs index 8f6e8b6270f..1b740db20be 100644 --- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs +++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs @@ -466,9 +466,10 @@ public partial class PermissiveModifyControl : System.DirectoryServices.Protocol } public delegate System.Security.Cryptography.X509Certificates.X509Certificate QueryClientCertificateCallback(System.DirectoryServices.Protocols.LdapConnection connection, byte[][] trustedCAs); public delegate System.DirectoryServices.Protocols.LdapConnection QueryForConnectionCallback(System.DirectoryServices.Protocols.LdapConnection primaryConnection, System.DirectoryServices.Protocols.LdapConnection referralFromConnection, string newDistinguishedName, System.DirectoryServices.Protocols.LdapDirectoryIdentifier identifier, System.Net.NetworkCredential credential, long currentUserToken); + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public partial class QuotaControl : System.DirectoryServices.Protocols.DirectoryControl { - public QuotaControl() : base (default(string), default(byte[]), default(bool), default(bool)) { } + public QuotaControl() : base (default(string), default(byte[]), default(bool), default(bool)) { } public QuotaControl(System.Security.Principal.SecurityIdentifier querySid) : base (default(string), default(byte[]), default(bool), default(bool)) { } public System.Security.Principal.SecurityIdentifier QuerySid { get { throw null; } set { } } public override byte[] GetValue() { throw null; } diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryControl.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryControl.cs index 4341ca2c60d..ce1b60c24b1 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryControl.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryControl.cs @@ -7,6 +7,7 @@ using System.Text; using System.Runtime.InteropServices; using System.Security.Principal; +using System.Runtime.Versioning; namespace System.DirectoryServices.Protocols { @@ -1020,6 +1021,7 @@ public byte[] ContextId public ResultCode Result { get; } } + [SupportedOSPlatform("windows")] public class QuotaControl : DirectoryControl { private byte[] _sid; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/StandardOleMarshalObject.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/StandardOleMarshalObject.Windows.cs index b23676166c1..175c1fc58d0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/StandardOleMarshalObject.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/StandardOleMarshalObject.Windows.cs @@ -21,6 +21,7 @@ protected StandardOleMarshalObject() private IntPtr GetStdMarshaler(ref Guid riid, int dwDestContext, int mshlflags) { + Debug.Assert(OperatingSystem.IsWindows()); IntPtr pUnknown = Marshal.GetIUnknownForObject(this); if (pUnknown != IntPtr.Zero) { @@ -69,6 +70,7 @@ unsafe int IMarshal.GetMarshalSizeMax(ref Guid riid, IntPtr pv, int dwDestContex } finally { + Debug.Assert(OperatingSystem.IsWindows()); Marshal.Release(pStandardMarshal); } } @@ -91,6 +93,7 @@ unsafe int IMarshal.MarshalInterface(IntPtr pStm, ref Guid riid, IntPtr pv, int } finally { + Debug.Assert(OperatingSystem.IsWindows()); Marshal.Release(pStandardMarshal); } } diff --git a/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj b/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj index 6a6d9a6a5b3..8deeb858dbb 100644 --- a/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj +++ b/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj @@ -2,6 +2,7 @@ true netstandard2.0;netstandard2.0-Windows_NT + true diff --git a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs index 6112112d59b..9bbb8e80f31 100644 --- a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs +++ b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs @@ -76,6 +76,7 @@ public partial class UnmanagedMemoryAccessor : System.IDisposable } namespace System.Runtime.CompilerServices { + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)] public sealed partial class IDispatchConstantAttribute : System.Runtime.CompilerServices.CustomConstantAttribute { diff --git a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/CompilerServices/IDispatchConstantAttribute.cs b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/CompilerServices/IDispatchConstantAttribute.cs index 3a3b8329e4c..ca08ee39bd2 100644 --- a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/CompilerServices/IDispatchConstantAttribute.cs +++ b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/CompilerServices/IDispatchConstantAttribute.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.InteropServices; +using System.Runtime.Versioning; namespace System.Runtime.CompilerServices { + [SupportedOSPlatform("windows")] [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] public sealed partial class IDispatchConstantAttribute : CustomConstantAttribute { diff --git a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/PasswordDeriveBytes.cs b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/PasswordDeriveBytes.cs index 4b5e73dc340..ee79a76f05c 100644 --- a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/PasswordDeriveBytes.cs +++ b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/PasswordDeriveBytes.cs @@ -25,6 +25,7 @@ public partial class PasswordDeriveBytes : DeriveBytes private HashAlgorithm? _hash; private readonly CspParameters? _cspParams; +#pragma warning disable CA1416 // Validate platform compatibility, CspParametersis is windows only type, we might want to annotate this constructors windows only, suppressing for now public PasswordDeriveBytes(string strPassword, byte[]? rgbSalt) : this(strPassword, rgbSalt, new CspParameters()) { } public PasswordDeriveBytes(byte[] password, byte[]? salt) : this(password, salt, new CspParameters()) { } @@ -34,6 +35,7 @@ public partial class PasswordDeriveBytes : DeriveBytes public PasswordDeriveBytes(byte[] password, byte[]? salt, string hashName, int iterations) : this(password, salt, hashName, iterations, new CspParameters()) { } +#pragma warning restore CA1416 public PasswordDeriveBytes(string strPassword, byte[]? rgbSalt, CspParameters? cspParams) : this(strPassword, rgbSalt, "SHA1", 100, cspParams) { } diff --git a/src/libraries/System.ServiceModel.Syndication/src/System.ServiceModel.Syndication.csproj b/src/libraries/System.ServiceModel.Syndication/src/System.ServiceModel.Syndication.csproj index 302d11eb2fc..73ebfaba0e9 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System.ServiceModel.Syndication.csproj +++ b/src/libraries/System.ServiceModel.Syndication/src/System.ServiceModel.Syndication.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent);netstandard2.0;net461-Windows_NT true + true diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj b/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj index 504f90a3241..4f2826bd93e 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj +++ b/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj @@ -4,6 +4,7 @@ enable $(NetCoreAppCurrent);$(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT;netstandard2.0-Windows_NT;net461-Windows_NT true + true -- GitLab