From: Eriawan Kusumawardhono Date: Tue, 15 Oct 2019 17:11:40 +0000 (+0700) Subject: Replace tfm based constants with SDK ones (dotnet/corefx#41601) X-Git-Tag: submit/tizen/20210909.063632~11031^2~298 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89174f25b00956fc27ce92052730a92c7b8e1ab8;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Replace tfm based constants with SDK ones (dotnet/corefx#41601) * replace DefineConstants with SDK ones Commit migrated from https://github.com/dotnet/corefx/commit/2133679ff62222ba2734232ab8fa4c65765e82a2 --- diff --git a/docs/libraries/coding-guidelines/package-projects.md b/docs/libraries/coding-guidelines/package-projects.md index c6594d3..81b5e8c 100644 --- a/docs/libraries/coding-guidelines/package-projects.md +++ b/docs/libraries/coding-guidelines/package-projects.md @@ -110,7 +110,7 @@ Sample \ref .builds file defining a constant used to filter API that were added Conditional compilation using the above-mentioned constant (from `ref\System.Net.Security.cs`): ``` -#if netcoreapp11 +#if NETCOREAPP public virtual void AuthenticateAsClient(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, bool checkCertificateRevocation) { } #endif ``` diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs index 524ece3..30d7051 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs @@ -374,7 +374,7 @@ namespace System.Net if (NetEventSource.IsEnabled) NetEventSource.Enter(null, contextAttribute); Span span = -#if netstandard +#if NETSTANDARD2_0 stackalloc T[1] { attribute }; #else MemoryMarshal.CreateSpan(ref attribute, 1); @@ -384,7 +384,7 @@ namespace System.Net MemoryMarshal.AsBytes(span), null, out SafeHandle sspiHandle); -#if netstandard +#if NETSTANDARD2_0 attribute = span[0]; #endif @@ -406,7 +406,7 @@ namespace System.Net if (NetEventSource.IsEnabled) NetEventSource.Enter(null, contextAttribute); Span span = -#if netstandard +#if NETSTANDARD2_0 stackalloc T[1] { attribute }; #else MemoryMarshal.CreateSpan(ref attribute, 1); @@ -416,7 +416,7 @@ namespace System.Net MemoryMarshal.AsBytes(span), safeHandleType, out sspiHandle); -#if netstandard +#if NETSTANDARD2_0 attribute = span[0]; #endif @@ -488,7 +488,7 @@ namespace System.Net if (NetEventSource.IsEnabled) NetEventSource.Enter(null); Span buffer = -#if netstandard +#if NETSTANDARD2_0 stackalloc Interop.SspiCli.SecPkgContext_IssuerListInfoEx[1] { ctx }; #else MemoryMarshal.CreateSpan(ref ctx, 1); @@ -499,7 +499,7 @@ namespace System.Net MemoryMarshal.AsBytes(buffer), typeof(SafeFreeContextBuffer), out sspiHandle); -#if netstandard +#if NETSTANDARD2_0 ctx = buffer[0]; #endif diff --git a/src/libraries/Common/src/System/Drawing/KnownColor.cs b/src/libraries/Common/src/System/Drawing/KnownColor.cs index ce2db64..f429786 100644 --- a/src/libraries/Common/src/System/Drawing/KnownColor.cs +++ b/src/libraries/Common/src/System/Drawing/KnownColor.cs @@ -9,7 +9,7 @@ namespace System.Drawing { [SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")] [TypeForwardedFrom("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] -#if netcoreapp20 +#if NETCOREAPP2_0 internal #else public diff --git a/src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs b/src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs index f031db5..f2f868b 100644 --- a/src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs +++ b/src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs @@ -80,7 +80,7 @@ namespace System.Net.Security ref byte[] resultBlob, ref ContextFlagsPal contextFlags) { -#if netstandard +#if NETSTANDARD2_0 Span inSecurityBufferSpan = new SecurityBuffer[2]; #else TwoSecurityBuffers twoSecurityBuffers = default; @@ -151,7 +151,7 @@ namespace System.Net.Security ref byte[] resultBlob, ref ContextFlagsPal contextFlags) { -#if netstandard +#if NETSTANDARD2_0 Span inSecurityBufferSpan = new SecurityBuffer[2]; #else TwoSecurityBuffers twoSecurityBuffers = default; @@ -223,7 +223,7 @@ namespace System.Net.Security // setup security buffers for ssp call // one points at signed data // two will receive payload if signature is valid -#if netstandard +#if NETSTANDARD2_0 Span securityBuffer = new SecurityBuffer[2]; #else TwoSecurityBuffers stackBuffer = default; @@ -270,7 +270,7 @@ namespace System.Net.Security Buffer.BlockCopy(buffer, offset, output, sizes.cbMaxSignature, count); // setup security buffers for ssp call -#if netstandard +#if NETSTANDARD2_0 Span securityBuffer = new SecurityBuffer[2]; #else TwoSecurityBuffers stackBuffer = default; diff --git a/src/libraries/Common/src/System/Net/SecurityProtocol.cs b/src/libraries/Common/src/System/Net/SecurityProtocol.cs index 0f6295b..04e4285 100644 --- a/src/libraries/Common/src/System/Net/SecurityProtocol.cs +++ b/src/libraries/Common/src/System/Net/SecurityProtocol.cs @@ -9,7 +9,7 @@ namespace System.Net internal static class SecurityProtocol { public const SslProtocols DefaultSecurityProtocols = -#if !netstandard && !netfx +#if !NETSTANDARD2_0 && !NETFRAMEWORK SslProtocols.Tls13 | #endif SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12; diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/FunctionWrapper.cs b/src/libraries/Common/src/System/Runtime/InteropServices/FunctionWrapper.cs index af0f815..b103f8b 100644 --- a/src/libraries/Common/src/System/Runtime/InteropServices/FunctionWrapper.cs +++ b/src/libraries/Common/src/System/Runtime/InteropServices/FunctionWrapper.cs @@ -65,7 +65,7 @@ namespace System.Runtime.InteropServices return new FunctionLoadResult(FunctionLoadResultKind.LibraryNotFound, null); } -#if netcoreapp20 +#if NETCOREAPP2_0 IntPtr funcPtr = LoadFunctionPointer(nativeLibraryHandle, funcName); if (funcPtr == IntPtr.Zero) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnCharacterStringEncodings.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnCharacterStringEncodings.cs index 791a6b4..fef0bdf 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnCharacterStringEncodings.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnCharacterStringEncodings.cs @@ -58,7 +58,7 @@ namespace System.Security.Cryptography.Asn1 } public -#if netcoreapp || netcoreapp30 || uap || NETCOREAPP || netstandard21 +#if uap || NETCOREAPP || NETSTANDARD2_1 override #endif int GetByteCount(ReadOnlySpan chars) @@ -93,7 +93,7 @@ namespace System.Security.Cryptography.Asn1 } public -#if netcoreapp || netcoreapp30 || uap || NETCOREAPP || netstandard21 +#if uap || NETCOREAPP || NETSTANDARD2_1 override #endif int GetCharCount(ReadOnlySpan bytes) @@ -397,7 +397,7 @@ namespace System.Security.Cryptography.Asn1 return s_utf8Encoding.GetByteCount(s); } -#if netcoreapp || netcoreapp30 || uap || NETCOREAPP || netstandard21 +#if uap || NETCOREAPP || NETSTANDARD2_1 public override int GetByteCount(ReadOnlySpan chars) { return s_utf8Encoding.GetByteCount(chars); @@ -438,7 +438,7 @@ namespace System.Security.Cryptography.Asn1 } } -#if netcoreapp || netcoreapp30 || uap || NETCOREAPP || netstandard21 +#if uap || NETCOREAPP || NETSTANDARD2_1 public override int GetCharCount(ReadOnlySpan bytes) { try diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnWriter.BitString.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnWriter.BitString.cs index ea54594..c3e1996 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnWriter.BitString.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnWriter.BitString.cs @@ -117,7 +117,7 @@ namespace System.Security.Cryptography.Asn1 _offset += bitString.Length; } -#if netcoreapp || uap || NETCOREAPP || netstandard21 +#if uap || NETCOREAPP || NETSTANDARD2_1 /// /// Write a Bit String value via a callback, with a tag UNIVERSAL 3. /// diff --git a/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs b/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs index f46f6c3..0aee627 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs @@ -20,7 +20,7 @@ namespace System.Security.Cryptography if (!clearWholeArray && clearSize != 0) { -#if netcoreapp || netcoreapp30 || uap || NETCOREAPP || netstandard21 +#if uap || NETCOREAPP || NETSTANDARD2_1 CryptographicOperations.ZeroMemory(array.AsSpan(0, clearSize)); #else Array.Clear(array, 0, clearSize); diff --git a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs index 5eb2556..dff6700 100644 --- a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs @@ -45,12 +45,12 @@ namespace System { get { -#if netcoreapp +#if NETCOREAPP if (IsWindows) { #endif return IsNotWindowsNanoServer && IsNotWindowsServerCore && !IsUap; -#if netcoreapp +#if NETCOREAPP } else if (IsOSX) { diff --git a/src/libraries/Common/tests/System/IO/Compression/ZipTestHelper.cs b/src/libraries/Common/tests/System/IO/Compression/ZipTestHelper.cs index a831ffe..61ae485 100644 --- a/src/libraries/Common/tests/System/IO/Compression/ZipTestHelper.cs +++ b/src/libraries/Common/tests/System/IO/Compression/ZipTestHelper.cs @@ -172,7 +172,7 @@ namespace System.IO.Compression.Tests using (Stream entrystream = entry.Open()) { entrystream.Read(buffer, 0, buffer.Length); -#if netcoreapp || uap +#if NETCOREAPP || uap uint zipcrc = entry.Crc32; Assert.Equal(CRC.CalculateCRC(buffer), zipcrc.ToString()); #endif diff --git a/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs b/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs index c6b5711..2092e6e 100644 --- a/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs @@ -380,7 +380,7 @@ namespace System.Net.Test.Common public int ListenBacklog { get; set; } = 1; public bool UseSsl { get; set; } = false; public SslProtocols SslProtocols { get; set; } = -#if !netstandard +#if !NETSTANDARD2_0 SslProtocols.Tls13 | #endif SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12; @@ -432,7 +432,7 @@ namespace System.Net.Test.Common _readStart += copyLength; return copyLength; } -#if NETSTANDARD +#if NETSTANDARD2_0 // stream does not have Memory overload byte[] tempBuffer = new byte[size]; int readLength = await _stream.ReadAsync(tempBuffer, 0, size).ConfigureAwait(false); diff --git a/src/libraries/Common/tests/System/Net/SslProtocolSupport.cs b/src/libraries/Common/tests/System/Net/SslProtocolSupport.cs index 6ea10ea..de8cf6d 100644 --- a/src/libraries/Common/tests/System/Net/SslProtocolSupport.cs +++ b/src/libraries/Common/tests/System/Net/SslProtocolSupport.cs @@ -12,7 +12,7 @@ namespace System.Net.Test.Common public class SslProtocolSupport { public const SslProtocols DefaultSslProtocols = -#if !netstandard +#if !NETSTANDARD2_0 SslProtocols.Tls13 | #endif SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; @@ -28,7 +28,7 @@ namespace System.Net.Test.Common supported |= SslProtocols.Ssl3; } #pragma warning restore 0618 -#if !netstandard +#if !NETSTANDARD2_0 // TLS 1.3 is new if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && PlatformDetection.OpenSslVersion >= new Version(1, 1, 1)) { diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignVerify.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignVerify.cs index 4548cef..37c6438 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignVerify.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignVerify.cs @@ -74,7 +74,7 @@ namespace System.Security.Cryptography.Dsa.Tests } } -#if netcoreapp +#if NETCOREAPP public sealed class DSASignVerify_Span : DSASignVerify { public override byte[] SignData(DSA dsa, byte[] data, HashAlgorithmName hashAlgorithm) => diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/CurveDef.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/CurveDef.cs index f1751c1..628b175 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/CurveDef.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/CurveDef.cs @@ -6,7 +6,7 @@ namespace System.Security.Cryptography.Tests { public class CurveDef { -#if netcoreapp +#if NETCOREAPP public CurveDef() { } public ECCurve Curve; public ECCurve.ECCurveType CurveType; diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/EccTestBase.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/EccTestBase.cs index 2d6b79e..b13d0e9 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/EccTestBase.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/EccTestBase.cs @@ -16,7 +16,7 @@ namespace System.Security.Cryptography.Tests /// public abstract class EccTestBase { -#if netcoreapp +#if NETCOREAPP internal const string ECDSA_P224_OID_VALUE = "1.3.132.0.33"; // Also called nistP224 or secP224r1 internal const string ECDSA_P256_OID_VALUE = "1.2.840.10045.3.1.7"; // Also called nistP256, secP256r1 or prime256v1(OpenSsl) internal const string ECDSA_P384_OID_VALUE = "1.3.132.0.34"; // Also called nistP384 or secP384r1 @@ -250,6 +250,6 @@ namespace System.Security.Cryptography.Tests } } } -#endif // netcoreapp +#endif } } diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanFactory.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanFactory.cs index 2952086..41718a9 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanFactory.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanFactory.cs @@ -8,7 +8,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests { ECDiffieHellman Create(); ECDiffieHellman Create(int keySize); -#if netcoreapp +#if NETCOREAPP ECDiffieHellman Create(ECCurve curve); #endif bool IsCurveValid(Oid oid); @@ -27,7 +27,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests return s_provider.Create(keySize); } -#if netcoreapp +#if NETCOREAPP public static ECDiffieHellman Create(ECCurve curve) { return s_provider.Create(curve); diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Hash.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Hash.cs index cb9e191..798b95a 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Hash.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Hash.cs @@ -260,7 +260,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests }; } -#if netcoreapp +#if NETCOREAPP [Theory] [MemberData(nameof(HashDerivationTestCases))] public static void HashDerivation_KnownResults( diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Hmac.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Hmac.cs index a060b24..3f2504b 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Hmac.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Hmac.cs @@ -316,7 +316,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests }; } -#if netcoreapp +#if NETCOREAPP [Theory] [MemberData(nameof(HmacDerivationTestCases))] public static void HmacDerivation_KnownResults( diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.ImportExport.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.ImportExport.cs index 418508a..fa9d529 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.ImportExport.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.ImportExport.cs @@ -8,7 +8,7 @@ using Xunit; namespace System.Security.Cryptography.EcDiffieHellman.Tests { -#if netcoreapp +#if NETCOREAPP public partial class ECDiffieHellmanTests { // On CentOS, secp224r1 (also called nistP224) appears to be disabled. To prevent test failures on that platform, diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.NistValidation.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.NistValidation.cs index 2eddcda..a245bf4 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.NistValidation.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.NistValidation.cs @@ -9,7 +9,7 @@ using Xunit; namespace System.Security.Cryptography.EcDiffieHellman.Tests { -#if netcoreapp +#if NETCOREAPP // These test cases are from http://csrc.nist.gov/groups/STM/cavp/component-testing.html#test-vectors // SP 800-56A ECCCDH Primitive test vectors // ecccdhtestvectors.zip diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Tls.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Tls.cs index c11badb..d62bb7c 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Tls.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.Tls.cs @@ -190,7 +190,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests }; } -#if netcoreapp +#if NETCOREAPP [Theory] [MemberData(nameof(TlsDerivationTestCases))] public static void TlsDerivation_KnownResults(string labelText, string answerHex) diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.cs index dc0d0fd..15964b3 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.cs @@ -158,7 +158,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests }); } -#if netcoreapp +#if NETCOREAPP private static ECDiffieHellman OpenKnownKey() { ECParameters ecParams = new ECParameters diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaFactory.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaFactory.cs index 80d51a7..221ad59 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaFactory.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaFactory.cs @@ -8,7 +8,7 @@ namespace System.Security.Cryptography.EcDsa.Tests { ECDsa Create(); ECDsa Create(int keySize); -#if netcoreapp +#if NETCOREAPP ECDsa Create(ECCurve curve); #endif bool IsCurveValid(Oid oid); @@ -27,7 +27,7 @@ namespace System.Security.Cryptography.EcDsa.Tests return s_provider.Create(keySize); } -#if netcoreapp +#if NETCOREAPP public static ECDsa Create(ECCurve curve) { return s_provider.Create(curve); diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaImportExport.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaImportExport.cs index b94fb22..fbd7850 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaImportExport.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaImportExport.cs @@ -10,7 +10,7 @@ namespace System.Security.Cryptography.EcDsa.Tests { public class ECDsaImportExportTests : ECDsaTestsBase { -#if netcoreapp +#if NETCOREAPP [Fact] public static void DiminishedCoordsRoundtrip() { diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaStub.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaStub.cs index c808a36..963ca97 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaStub.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaStub.cs @@ -31,7 +31,7 @@ namespace System.Security.Cryptography.EcDsa.Tests throw new NotImplementedException(); } -#if netcoreapp +#if NETCOREAPP public override void ImportParameters(ECParameters parameters) { throw new NotImplementedException(); diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.NistValidation.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.NistValidation.cs index 3fc5629..13ad915 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.NistValidation.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.NistValidation.cs @@ -14,7 +14,7 @@ namespace System.Security.Cryptography.EcDsa.Tests // FIPS 186-4 ECDSA test vectors // 186-3ecdsatestvectors.zip // SigGen.txt -#if netcoreapp +#if NETCOREAPP [Fact] public static void ValidateNistP256Sha256() { @@ -287,6 +287,6 @@ namespace System.Security.Cryptography.EcDsa.Tests } } } -#endif // netcoreapp +#endif } } diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTestsBase.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTestsBase.cs index 4afe3a0..2211cf0 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTestsBase.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTestsBase.cs @@ -15,7 +15,7 @@ namespace System.Security.Cryptography.EcDsa.Tests /// public abstract class ECDsaTestsBase : EccTestBase { -#if netcoreapp +#if NETCOREAPP internal static void Verify256(ECDsa e, bool expected) { byte[] sig = ("998791331eb2e1f4259297f5d9cb82fa20dec98e1cb0900e6b8f014a406c3d02cbdbf5238bde471c3155fc25565524301429" @@ -41,7 +41,7 @@ namespace System.Security.Cryptography.EcDsa.Tests return ECDsaFactory.ExplicitCurvesSupported; } } -#endif // netcoreapp +#endif } internal static class EcDsaTestExtensions diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 93d7a81..a602041 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -4,7 +4,6 @@ false true - true true diff --git a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs index 2aa625a..6805291 100644 --- a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs +++ b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs @@ -119,7 +119,7 @@ namespace System.Collections.Immutable public System.Collections.Immutable.ImmutableArray Add(T item) { throw null; } public System.Collections.Immutable.ImmutableArray AddRange(System.Collections.Generic.IEnumerable items) { throw null; } public System.Collections.Immutable.ImmutableArray AddRange(System.Collections.Immutable.ImmutableArray items) { throw null; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public System.ReadOnlyMemory AsMemory() { throw null; } public System.ReadOnlySpan AsSpan() { throw null; } #endif @@ -143,7 +143,7 @@ namespace System.Collections.Immutable public System.Collections.Immutable.ImmutableArray Insert(int index, T item) { throw null; } public System.Collections.Immutable.ImmutableArray InsertRange(int index, System.Collections.Generic.IEnumerable items) { throw null; } public System.Collections.Immutable.ImmutableArray InsertRange(int index, System.Collections.Immutable.ImmutableArray items) { throw null; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly T ItemRef(int index) { throw null; } #endif public int LastIndexOf(T item) { throw null; } @@ -228,7 +228,7 @@ namespace System.Collections.Immutable public int IndexOf(T item, int startIndex, int count) { throw null; } public int IndexOf(T item, int startIndex, int count, System.Collections.Generic.IEqualityComparer equalityComparer) { throw null; } public void Insert(int index, T item) { } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly T ItemRef(int index) { throw null; } #endif public int LastIndexOf(T item) { throw null; } @@ -581,7 +581,7 @@ namespace System.Collections.Immutable public int IndexOf(T item, int index, int count, System.Collections.Generic.IEqualityComparer equalityComparer) { throw null; } public System.Collections.Immutable.ImmutableList Insert(int index, T item) { throw null; } public System.Collections.Immutable.ImmutableList InsertRange(int index, System.Collections.Generic.IEnumerable items) { throw null; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly T ItemRef(int index) { throw null; } #endif public int LastIndexOf(T item, int index, int count, System.Collections.Generic.IEqualityComparer equalityComparer) { throw null; } @@ -671,7 +671,7 @@ namespace System.Collections.Immutable public int IndexOf(T item, int index, int count, System.Collections.Generic.IEqualityComparer equalityComparer) { throw null; } public void Insert(int index, T item) { } public void InsertRange(int index, System.Collections.Generic.IEnumerable items) { } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly T ItemRef(int index) { throw null; } #endif public int LastIndexOf(T item) { throw null; } @@ -730,7 +730,7 @@ namespace System.Collections.Immutable public System.Collections.Immutable.ImmutableQueue Enqueue(T value) { throw null; } public System.Collections.Immutable.ImmutableQueue.Enumerator GetEnumerator() { throw null; } public T Peek() { throw null; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly T PeekRef() { throw null; } #endif System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } @@ -823,7 +823,7 @@ namespace System.Collections.Immutable public System.Collections.Immutable.ImmutableSortedDictionary.Builder ToBuilder() { throw null; } public bool TryGetKey(TKey equalKey, out TKey actualKey) { throw null; } public bool TryGetValue(TKey key, out TValue value) { throw null; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly TValue ValueRef(TKey key) { throw null; } #endif public System.Collections.Immutable.ImmutableSortedDictionary WithComparers(System.Collections.Generic.IComparer keyComparer) { throw null; } @@ -871,7 +871,7 @@ namespace System.Collections.Immutable public System.Collections.Immutable.ImmutableSortedDictionary ToImmutable() { throw null; } public bool TryGetKey(TKey equalKey, out TKey actualKey) { throw null; } public bool TryGetValue(TKey key, out TValue value) { throw null; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly TValue ValueRef(TKey key) { throw null; } #endif } @@ -931,7 +931,7 @@ namespace System.Collections.Immutable public bool IsProperSupersetOf(System.Collections.Generic.IEnumerable other) { throw null; } public bool IsSubsetOf(System.Collections.Generic.IEnumerable other) { throw null; } public bool IsSupersetOf(System.Collections.Generic.IEnumerable other) { throw null; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly T ItemRef(int index) { throw null; } #endif public bool Overlaps(System.Collections.Generic.IEnumerable other) { throw null; } @@ -992,7 +992,7 @@ namespace System.Collections.Immutable public bool IsProperSupersetOf(System.Collections.Generic.IEnumerable other) { throw null; } public bool IsSubsetOf(System.Collections.Generic.IEnumerable other) { throw null; } public bool IsSupersetOf(System.Collections.Generic.IEnumerable other) { throw null; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly T ItemRef(int index) { throw null; } #endif public bool Overlaps(System.Collections.Generic.IEnumerable other) { throw null; } @@ -1036,7 +1036,7 @@ namespace System.Collections.Immutable public System.Collections.Immutable.ImmutableStack Clear() { throw null; } public System.Collections.Immutable.ImmutableStack.Enumerator GetEnumerator() { throw null; } public T Peek() { throw null; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ref readonly T PeekRef() { throw null; } #endif public System.Collections.Immutable.ImmutableStack Pop() { throw null; } diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Builder.cs index 609e751..97712e5 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Builder.cs @@ -159,7 +159,7 @@ namespace System.Collections.Immutable } } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference to the element at the specified index. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs index 706ce5a..4b59ffc 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs @@ -131,7 +131,7 @@ namespace System.Collections.Immutable } } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference to the element at the specified index in the read-only list. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.cs index dc827b1..a8aaab4 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.cs @@ -92,7 +92,7 @@ namespace System.Collections.Immutable } } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public ReadOnlySpan AsSpan() => new ReadOnlySpan(array); public ReadOnlyMemory AsMemory() => new ReadOnlyMemory(array); diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.HashBucket.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.HashBucket.cs index d22990b..c3612ff 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.HashBucket.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.HashBucket.cs @@ -186,7 +186,7 @@ namespace System.Collections.Immutable result = OperationResult.NoChangeRequired; return this; case KeyCollisionBehavior.ThrowIfValueDifferent: -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 ref readonly var existingEntry = ref _additionalElements.ItemRef(keyCollisionIndex); #else var existingEntry = _additionalElements[keyCollisionIndex]; @@ -281,7 +281,7 @@ namespace System.Collections.Immutable return false; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 value = _additionalElements.ItemRef(index).Value; #else value = _additionalElements[index].Value; @@ -324,7 +324,7 @@ namespace System.Collections.Immutable return false; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 actualKey = _additionalElements.ItemRef(index).Key; #else actualKey = _additionalElements[index].Key; diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.HashBucket.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.HashBucket.cs index 1a372f1..d830c06 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.HashBucket.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.HashBucket.cs @@ -182,7 +182,7 @@ namespace System.Collections.Immutable int index = _additionalElements.IndexOf(value, valueComparer); if (index >= 0) { -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 existingValue = _additionalElements.ItemRef(index); #else existingValue = _additionalElements[index]; diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs index cc8ac35..460fc0a 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs @@ -135,7 +135,7 @@ namespace System.Collections.Immutable { get { -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 return this.Root.ItemRef(index); #else return this.Root[index]; @@ -159,7 +159,7 @@ namespace System.Collections.Immutable } } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference to the value for a given index into the list. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Node.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Node.cs index 06f4e67..f62bbf9 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Node.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Node.cs @@ -187,7 +187,7 @@ namespace System.Collections.Immutable } } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference to the element of the set at the given index. /// @@ -524,7 +524,7 @@ namespace System.Collections.Immutable int end = index + count - 1; while (start < end) { -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 T a = result.ItemRef(start); T b = result.ItemRef(end); #else diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs index 946f065..55059b7 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs @@ -169,13 +169,13 @@ namespace System.Collections.Immutable /// The 0-based index of the element in the set to return. /// The element at the given position. /// Thrown from getter when is negative or not less than . -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 public T this[int index] => _root.ItemRef(index); #else public T this[int index] => _root[index]; #endif -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference to the element of the set at the given index. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs index 1f3c906..92eb566 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs @@ -138,7 +138,7 @@ namespace System.Collections.Immutable return _forwards.Peek(); } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference to the element at the front of the queue. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs index e77548e..a91ff61 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs @@ -202,7 +202,7 @@ namespace System.Collections.Immutable } } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Returns a read-only reference to the value associated with the provided key. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Node.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Node.cs index 94827ce..b4e4349 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Node.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Node.cs @@ -329,7 +329,7 @@ namespace System.Collections.Immutable return this.RemoveRecursive(key, keyComparer, out mutated); } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Returns a read-only reference to the value associated with the provided key. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs index 3c8dff5..f87a5f8 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs @@ -209,7 +209,7 @@ namespace System.Collections.Immutable } } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Returns a read-only reference to the value associated with the provided key. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs index 66d3017..f392be6 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs @@ -105,14 +105,14 @@ namespace System.Collections.Immutable /// public T this[int index] { -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 get { return _root.ItemRef(index); } #else get { return _root[index]; } #endif } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference to the element of the set at the given index. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Node.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Node.cs index 42ac6ac..ed5a5eb 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Node.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Node.cs @@ -253,7 +253,7 @@ namespace System.Collections.Immutable } } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference to the element of the set at the given index. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs index 9f76d06..6b49ad3 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs @@ -148,7 +148,7 @@ namespace System.Collections.Immutable { get { -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 return _root.ItemRef(index); #else return _root[index]; @@ -156,7 +156,7 @@ namespace System.Collections.Immutable } } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference of the element of the set at the given index. /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs index ce3053e..e133cca 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs @@ -117,7 +117,7 @@ namespace System.Collections.Immutable return _head; } -#if !NETSTANDARD10 +#if !NETSTANDARD1_0 /// /// Gets a read-only reference to the element on the top of the stack. /// diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs index f1f2b40..fb231f0 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs @@ -793,7 +793,7 @@ namespace System.Collections.Immutable.Tests Assert.IsType(tie.InnerException); } -#if netcoreapp +#if NETCOREAPP [Fact] public void UsableWithCollectibleAssemblies() { @@ -812,7 +812,7 @@ namespace System.Collections.Immutable.Tests list.GetEnumerator(); // ensure this doesn't throw } -#endif // netcoreapp +#endif [Fact] public void ItemRef() diff --git a/src/libraries/System.Data.SqlClient/src/System.Data.SqlClient.csproj b/src/libraries/System.Data.SqlClient/src/System.Data.SqlClient.csproj index cbbdf95..c9a74b3 100644 --- a/src/libraries/System.Data.SqlClient/src/System.Data.SqlClient.csproj +++ b/src/libraries/System.Data.SqlClient/src/System.Data.SqlClient.csproj @@ -8,8 +8,7 @@ SR.PlatformNotSupported_DataSqlClient 4.0.0.0 4.1.0.0 - $(DefineConstants);netstandard - $(DefineConstants);netcoreapp + $(DefineConstants);NETSTANDARD2_0 $(DefineConstants);FEATURE_TCPKEEPALIVE $(DefineConstants);INTERNAL_NULLABLE_ATTRIBUTES net461-Windows_NT-Debug;net461-Windows_NT-Release;netcoreapp-Debug;netcoreapp-Release;netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netcoreapp2.1-Debug;netcoreapp2.1-Release;netcoreapp2.1-Unix-Debug;netcoreapp2.1-Unix-Release;netcoreapp2.1-Windows_NT-Debug;netcoreapp2.1-Windows_NT-Release;netfx-Windows_NT-Debug;netfx-Windows_NT-Release;netstandard-Debug;netstandard-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release;netstandard1.2-Debug;netstandard1.2-Release;netstandard1.3-Debug;netstandard1.3-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release;uap10.0.16299-Windows_NT-Debug;uap10.0.16299-Windows_NT-Release diff --git a/src/libraries/System.Data.SqlClient/src/System/Data/Common/DbConnectionStringCommon.cs b/src/libraries/System.Data.SqlClient/src/System/Data/Common/DbConnectionStringCommon.cs index 3e65e5c..47422c6 100644 --- a/src/libraries/System.Data.SqlClient/src/System/Data/Common/DbConnectionStringCommon.cs +++ b/src/libraries/System.Data.SqlClient/src/System/Data/Common/DbConnectionStringCommon.cs @@ -306,7 +306,7 @@ namespace System.Data.Common internal const string MaxPoolSize = "Max Pool Size"; internal const string Pooling = "Pooling"; internal const string MinPoolSize = "Min Pool Size"; -#if netcoreapp +#if NETCOREAPP internal const string PoolBlockingPeriod = "PoolBlockingPeriod"; #endif } diff --git a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs index d8b2cd9..af8ba0c 100644 --- a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs +++ b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Diagnostics; -#if !netcoreapp +#if NETCOREAPP2_1 || !NETCOREAPP using System.Linq; #endif using System.Net; @@ -562,7 +562,7 @@ namespace System.Data.SqlClient.SNI ? _workingDataSource.Substring(firstIndexOfColon + 1).Trim() : _workingDataSource; // Pipe paths only allow back slashes -#if netcoreapp +#if NETCOREAPP if (_dataSourceAfterTrimmingProtocol.Contains('/')) // string.Contains(char) is .NetCore2.1+ specific #else if (_dataSourceAfterTrimmingProtocol.Contains("/")) diff --git a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionString.cs b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionString.cs index a15dbbe..b7bd4a1 100644 --- a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionString.cs +++ b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionString.cs @@ -56,7 +56,7 @@ namespace System.Data.SqlClient internal const string Application_Name = "application name"; internal const string AsynchronousProcessing = "asynchronous processing"; internal const string AttachDBFilename = "attachdbfilename"; -#if netcoreapp +#if NETCOREAPP internal const string PoolBlockingPeriod = "poolblockingperiod"; #endif internal const string Connect_Timeout = "connect timeout"; @@ -220,7 +220,7 @@ namespace System.Data.SqlClient } _integratedSecurity = ConvertValueToIntegratedSecurity(); -#if netcoreapp +#if NETCOREAPP _poolBlockingPeriod = ConvertValueToPoolBlockingPeriod(); #endif _encrypt = ConvertValueToBoolean(KEY.Encrypt, DEFAULT.Encrypt); @@ -420,7 +420,7 @@ namespace System.Data.SqlClient _userInstance = userInstance; _connectTimeout = connectionOptions._connectTimeout; _loadBalanceTimeout = connectionOptions._loadBalanceTimeout; -#if netcoreapp +#if NETCOREAPP _poolBlockingPeriod = connectionOptions._poolBlockingPeriod; #endif _maxPoolSize = connectionOptions._maxPoolSize; @@ -504,7 +504,7 @@ namespace System.Data.SqlClient { KEY.Application_Name, KEY.Application_Name }, { KEY.AsynchronousProcessing, KEY.AsynchronousProcessing }, { KEY.AttachDBFilename, KEY.AttachDBFilename }, -#if netcoreapp +#if NETCOREAPP { KEY.PoolBlockingPeriod, KEY.PoolBlockingPeriod}, #endif { KEY.Connect_Timeout, KEY.Connect_Timeout }, diff --git a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionStringBuilder.cs b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionStringBuilder.cs index 402c952..733f604 100644 --- a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionStringBuilder.cs +++ b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionStringBuilder.cs @@ -30,7 +30,7 @@ namespace System.Data.SqlClient Pooling, MinPoolSize, MaxPoolSize, -#if netcoreapp +#if NETCOREAPP PoolBlockingPeriod, #endif @@ -109,7 +109,7 @@ namespace System.Data.SqlClient validKeywords[(int)Keywords.ApplicationIntent] = DbConnectionStringKeywords.ApplicationIntent; validKeywords[(int)Keywords.ApplicationName] = DbConnectionStringKeywords.ApplicationName; validKeywords[(int)Keywords.AttachDBFilename] = DbConnectionStringKeywords.AttachDBFilename; -#if netcoreapp +#if NETCOREAPP validKeywords[(int)Keywords.PoolBlockingPeriod] = DbConnectionStringKeywords.PoolBlockingPeriod; #endif validKeywords[(int)Keywords.ConnectTimeout] = DbConnectionStringKeywords.ConnectTimeout; @@ -148,7 +148,7 @@ namespace System.Data.SqlClient hash.Add(DbConnectionStringKeywords.ApplicationIntent, Keywords.ApplicationIntent); hash.Add(DbConnectionStringKeywords.ApplicationName, Keywords.ApplicationName); hash.Add(DbConnectionStringKeywords.AttachDBFilename, Keywords.AttachDBFilename); -#if netcoreapp +#if NETCOREAPP hash.Add(DbConnectionStringKeywords.PoolBlockingPeriod, Keywords.PoolBlockingPeriod); #endif hash.Add(DbConnectionStringKeywords.ConnectTimeout, Keywords.ConnectTimeout); @@ -248,7 +248,7 @@ namespace System.Data.SqlClient case Keywords.PacketSize: PacketSize = ConvertToInt32(value); break; case Keywords.IntegratedSecurity: IntegratedSecurity = ConvertToIntegratedSecurity(value); break; -#if netcoreapp +#if NETCOREAPP case Keywords.PoolBlockingPeriod: PoolBlockingPeriod = ConvertToPoolBlockingPeriod(keyword, value); break; #endif case Keywords.Encrypt: Encrypt = ConvertToBoolean(value); break; @@ -682,7 +682,7 @@ namespace System.Data.SqlClient case Keywords.ApplicationIntent: return this.ApplicationIntent; case Keywords.ApplicationName: return ApplicationName; case Keywords.AttachDBFilename: return AttachDBFilename; -#if netcoreapp +#if NETCOREAPP case Keywords.PoolBlockingPeriod: return PoolBlockingPeriod; #endif case Keywords.ConnectTimeout: return ConnectTimeout; @@ -759,7 +759,7 @@ namespace System.Data.SqlClient case Keywords.AttachDBFilename: _attachDBFilename = DbConnectionStringDefaults.AttachDBFilename; break; -#if netcoreapp +#if NETCOREAPP case Keywords.PoolBlockingPeriod: _poolBlockingPeriod = DbConnectionStringDefaults.PoolBlockingPeriod; break; diff --git a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/TdsValueSetter.cs b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/TdsValueSetter.cs index 50b782c..d47cd17 100644 --- a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/TdsValueSetter.cs +++ b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/TdsValueSetter.cs @@ -603,7 +603,7 @@ namespace System.Data.SqlClient internal void SetGuid(Guid value) { Debug.Assert(SmiXetterAccessMap.IsSetterAccessValid(_metaData, SmiXetterTypeCode.XetGuid)); -#if netcoreapp +#if NETCOREAPP Span bytes = stackalloc byte[16]; value.TryWriteBytes(bytes); #else @@ -621,7 +621,7 @@ namespace System.Data.SqlClient _stateObj.WriteByte((byte)_metaData.MaxLength); } -#if netcoreapp +#if NETCOREAPP _stateObj.WriteByteSpan(bytes); #else _stateObj.WriteByteArray(bytes, bytes.Length, 0); diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs index 238a412..3885c03 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs @@ -15,7 +15,7 @@ using System.IO; using static Interop.Advapi32; -#if !netcoreapp +#if NETCOREAPP2_0 || !NETCOREAPP using MemoryMarshal = System.Diagnostics.PerformanceCounterLib; #endif @@ -106,7 +106,7 @@ namespace System.Diagnostics } } -#if !netcoreapp +#if NETCOREAPP2_0 || !NETCOREAPP internal static T Read(ReadOnlySpan span) where T : struct => System.Runtime.InteropServices.MemoryMarshal.Read(span); diff --git a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs index b56c9b1..21a6388 100644 --- a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs +++ b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs @@ -270,7 +270,7 @@ namespace System.Drawing Whiteness = 16711778, CaptureBlt = 1073741824, } -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [System.ComponentModel.TypeConverterAttribute("System.Drawing.FontConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif public sealed partial class Font : System.MarshalByRefObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable @@ -631,7 +631,7 @@ namespace System.Drawing Document = 5, Millimeter = 6, } -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [System.ComponentModel.TypeConverterAttribute("System.Drawing.IconConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif public sealed partial class Icon : System.MarshalByRefObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable @@ -668,7 +668,7 @@ namespace System.Drawing void ReleaseHdc(); } [System.ComponentModel.ImmutableObjectAttribute(true)] -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [System.ComponentModel.TypeConverterAttribute("System.Drawing.ImageConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif public abstract partial class Image : System.MarshalByRefObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable @@ -2290,7 +2290,7 @@ namespace System.Drawing.Imaging ReadOnly = 65536, Caching = 131072, } -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [System.ComponentModel.TypeConverterAttribute("System.Drawing.ImageFormatConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif public sealed partial class ImageFormat @@ -2489,7 +2489,7 @@ namespace System.Drawing.Printing protected InvalidPrinterException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [System.ComponentModel.TypeConverterAttribute("System.Drawing.Printing.MarginsConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif public partial class Margins : System.ICloneable diff --git a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj index 7f57129..52233aa 100644 --- a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj @@ -1,17 +1,15 @@  - Library $(DefineConstants);DRAWING_NAMESPACE true CS0618 - $(DefineConstants);NETCORE $(DefineConstants);FEATURE_WINDOWS_SYSTEM_COLORS;FEATURE_SYSTEM_EVENTS true SR.PlatformNotSupported_Drawing netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netcoreapp3.0-Unix-Debug;netcoreapp3.0-Unix-Release;netcoreapp3.0-Windows_NT-Debug;netcoreapp3.0-Windows_NT-Release;uap-Debug;uap-Release - + @@ -166,7 +164,7 @@ - + @@ -271,7 +269,7 @@ - + diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.Unix.cs index 65bf823..9599bd0 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.Unix.cs @@ -46,9 +46,6 @@ using System.ComponentModel; namespace System.Drawing { -#if !NETCORE - [Editor ("System.Drawing.Design.BitmapEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))] -#endif public sealed partial class Bitmap { #region constructors diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Font.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Font.Unix.cs index 46a84d6..a29f99d 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Font.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Font.Unix.cs @@ -41,10 +41,6 @@ using Gdip = System.Drawing.SafeNativeMethods.Gdip; namespace System.Drawing { -#if !NETCORE - [Editor ("System.Drawing.Design.FontEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))] - [TypeConverter (typeof (FontConverter))] -#endif public sealed partial class Font { private const byte DefaultCharSet = 1; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Font.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Font.cs index a32ac69..e22e8b2 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Font.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Font.cs @@ -14,7 +14,7 @@ namespace System.Drawing /// /// Defines a particular format for text, including font face, size, and style attributes. /// -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [TypeConverter("System.Drawing.FontConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif [Serializable] @@ -77,18 +77,11 @@ namespace System.Drawing /// Gets the face name of this . /// [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] -#if !NETCORE - [Editor ("System.Drawing.Design.FontNameEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))] - [TypeConverter (typeof (FontConverter.FontNameConverter))] -#endif public string Name => FontFamily.Name; /// /// Gets the unit of measure for this . /// -#if !NETCORE - [TypeConverter (typeof (FontConverter.FontUnitConverter))] -#endif public GraphicsUnit Unit => _fontUnit; /// diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiPlusStreamHelper.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiPlusStreamHelper.Unix.cs index 3a2f8b7..23494a1 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiPlusStreamHelper.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiPlusStreamHelper.Unix.cs @@ -34,10 +34,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if netcoreapp20 -using System.Buffers; -#endif - using System.IO; using System.Runtime.InteropServices; @@ -97,16 +93,8 @@ namespace System.Drawing try { - // Stream Span API isn't available in 2.0 -#if netcoreapp20 - byte[] buffer = ArrayPool.Shared.Rent(bufsz); - read = _stream.Read(buffer, 0, bufsz); - Marshal.Copy(buffer, 0, (IntPtr)buf, read); - ArrayPool.Shared.Return(buffer); -#else Span buffer = new Span(buf, bufsz); read = _stream.Read(buffer); -#endif } catch (IOException) { @@ -136,16 +124,9 @@ namespace System.Drawing if (!_stream.CanWrite) return -1; - // Stream Span API isn't available in 2.0 -#if netcoreapp20 - byte[] buffer = ArrayPool.Shared.Rent(bufsz); - Marshal.Copy((IntPtr)buf, buffer, 0, bufsz); - _stream.Write(buffer, 0, bufsz); - ArrayPool.Shared.Return(buffer); -#else var buffer = new ReadOnlySpan(buf, bufsz); _stream.Write(buffer); -#endif + return bufsz; } diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs index c3d9de2..5640a2d 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs @@ -36,12 +36,8 @@ namespace System.Drawing { libraryName = "libgdiplus.dylib"; -#if netcoreapp20 - lib = Interop.Libdl.dlopen(libraryName, Interop.Libdl.RTLD_LAZY); -#else // use managed NativeLibrary API from .NET Core 3 onwards var assembly = System.Reflection.Assembly.GetExecutingAssembly(); NativeLibrary.TryLoad(libraryName, assembly, default, out lib); -#endif } else { @@ -51,40 +47,12 @@ namespace System.Drawing // the name suffixed with ".0". libraryName = "libgdiplus.so"; -#if netcoreapp20 - lib = Interop.Libdl.dlopen(libraryName, Interop.Libdl.RTLD_LAZY); - if (lib == IntPtr.Zero) - { - lib = Interop.Libdl.dlopen("libgdiplus.so.0", Interop.Libdl.RTLD_LAZY); - } -#else // use managed NativeLibrary API from .NET Core 3 onwards var assembly = System.Reflection.Assembly.GetExecutingAssembly(); if (!NativeLibrary.TryLoad(libraryName, assembly, default, out lib)) { NativeLibrary.TryLoad("libgdiplus.so.0", assembly, default, out lib); } -#endif - } - -#if netcoreapp20 - // If we couldn't find libgdiplus in the system search path, try to look for libgdiplus in the - // NuGet package folders. This matches the DllImport behavior. - if (lib == IntPtr.Zero) - { - string[] searchDirectories = ((string)AppContext.GetData("NATIVE_DLL_SEARCH_DIRECTORIES")).Split(':'); - - foreach (var searchDirectory in searchDirectories) - { - var searchPath = Path.Combine(searchDirectory, libraryName); - - lib = Interop.Libdl.dlopen(searchPath, Interop.Libdl.RTLD_LAZY); - if (lib != IntPtr.Zero) - { - break; - } - } } -#endif // This function may return a null handle. If it does, individual functions loaded from it will throw a DllNotFoundException, // but not until an attempt is made to actually use the function (rather than load it). This matches how PInvokes behave. diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs index 2a58b9a..74abe56 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs @@ -44,15 +44,8 @@ using System.Runtime.InteropServices; namespace System.Drawing { -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [System.ComponentModel.TypeConverter("System.Drawing.IconConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] -#else -#if !NETCORE -#if !MONOTOUCH - [Editor("System.Drawing.Design.IconEditor, " + Consts.AssemblySystem_Drawing_Design, typeof(System.Drawing.Design.UITypeEditor))] -#endif - [TypeConverter(typeof(IconConverter))] -#endif #endif [Serializable] [System.Runtime.CompilerServices.TypeForwardedFrom("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] @@ -134,7 +127,6 @@ namespace System.Drawing { } -#if !MONOTOUCH private Icon(IntPtr handle) { this.handle = handle; @@ -145,7 +137,6 @@ namespace System.Drawing // FIXME: we need to convert the bitmap into an icon undisposable = true; } -#endif public Icon(Icon original, int width, int height) : this(original, new Size(width, height)) @@ -352,7 +343,6 @@ namespace System.Drawing return new Icon(this, Size); } -#if !MONOTOUCH public static Icon FromHandle(IntPtr handle) { if (handle == IntPtr.Zero) @@ -360,7 +350,7 @@ namespace System.Drawing return new Icon(handle); } -#endif + private void SaveIconImage(BinaryWriter writer, IconImage ii) { BitmapInfoHeader bih = ii.iconHeader; @@ -542,7 +532,7 @@ namespace System.Drawing // save every icons available Save(outputStream, -1, -1); } -#if !MONOTOUCH + internal Bitmap BuildBitmapOnWin32() { Bitmap bmp; @@ -653,14 +643,13 @@ namespace System.Drawing // Image16 for the differences return new Bitmap(GetInternalBitmap()); } -#endif + public override string ToString() { //is this correct, this is what returned by .Net return ""; } -#if !MONOTOUCH [Browsable(false)] public IntPtr Handle { @@ -679,7 +668,7 @@ namespace System.Drawing return handle; } } -#endif + [Browsable(false)] public int Height { diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.cs index 18e9132..caaf047 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.cs @@ -14,11 +14,11 @@ using System.Runtime.Serialization; namespace System.Drawing { - [Serializable] - [TypeForwardedFrom("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [TypeConverter("System.Drawing.IconConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif + [Serializable] + [TypeForwardedFrom("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] public sealed partial class Icon : MarshalByRefObject, ICloneable, IDisposable, ISerializable { #if FINALIZATION_WATCH diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Image.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Image.Unix.cs index 1604a34..f844c9a 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Image.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Image.Unix.cs @@ -45,10 +45,6 @@ using Gdip = System.Drawing.SafeNativeMethods.Gdip; namespace System.Drawing { -#if !NETCORE -[Editor ("System.Drawing.Design.ImageEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))] -[TypeConverter (typeof(ImageConverter))] -#endif public abstract partial class Image { // public methods diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Image.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Image.cs index b87bdc9..5490032 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Image.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Image.cs @@ -18,7 +18,7 @@ namespace System.Drawing [ImmutableObject(true)] [Serializable] [System.Runtime.CompilerServices.TypeForwardedFrom("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [TypeConverter("System.Drawing.ImageConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif public abstract partial class Image : MarshalByRefObject, IDisposable, ICloneable, ISerializable @@ -43,10 +43,6 @@ namespace System.Drawing [Localizable(false)] [DefaultValue(null)] -#if !NETCORE - [BindableAttribute(true)] - [TypeConverter(typeof(StringConverter))] -#endif public object Tag { get => _userData; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/ImageFormat.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/ImageFormat.cs index 394a401..1ab3149 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/ImageFormat.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/ImageFormat.cs @@ -9,7 +9,7 @@ namespace System.Drawing.Imaging /// /// Specifies the format of the image. /// -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [TypeConverter("System.Drawing.ImageFormatConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif public sealed class ImageFormat diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/Metafile.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/Metafile.Unix.cs index 3ef5808..39f55ae 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/Metafile.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/Metafile.Unix.cs @@ -40,9 +40,6 @@ using System.Runtime.Serialization; namespace System.Drawing.Imaging { -#if !NETCORE - [Editor ("System.Drawing.Design.MetafileEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))] -#endif public sealed partial class Metafile : Image { // Usually called when cloning images that need to have diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Internal/GPStream.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Internal/GPStream.cs index 1150260..a26c203 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Internal/GPStream.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Internal/GPStream.cs @@ -204,16 +204,8 @@ namespace System.Drawing.Internal { ActualizeVirtualPosition(); - // Stream Span API isn't available in 2.0 -#if netcoreapp20 - byte[] buffer = ArrayPool.Shared.Rent(checked((int)cb)); - Marshal.Copy((IntPtr)pv, buffer, 0, checked((int)cb)); - _dataStream.Write(buffer, 0, checked((int)cb)); - ArrayPool.Shared.Return(buffer); -#else var buffer = new ReadOnlySpan(pv, checked((int)cb)); _dataStream.Write(buffer); -#endif if (pcbWritten != null) *pcbWritten = cb; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/Margins.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/Margins.cs index c48c75c..a83af80 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/Margins.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/Margins.cs @@ -11,7 +11,7 @@ namespace System.Drawing.Printing /// /// Specifies the margins of a printed page. /// -#if netcoreapp || netcoreapp30 +#if NETCOREAPP [TypeConverter("System.Drawing.Printing.MarginsConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")] #endif public partial class Margins : ICloneable diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintDocument.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintDocument.Unix.cs index 927d9fa..304d556 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintDocument.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintDocument.Unix.cs @@ -40,10 +40,6 @@ using System.ComponentModel; namespace System.Drawing.Printing { -#if !NETCORE - [DefaultEvent ("PrintPage"), DefaultProperty ("DocumentName")] - [ToolboxItemFilter ("System.Drawing.Printing", ToolboxItemFilterType.Allow)] -#endif public class PrintDocument : System.ComponentModel.Component { private PageSettings defaultpagesettings; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs index 65291eb..1ee2344 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs @@ -98,11 +98,7 @@ namespace System.Drawing.Printing } catch (DllNotFoundException) { -#if NETCORE System.Diagnostics.Debug.WriteLine("libcups not found. To have printing support, you need cups installed"); -#else - Console.WriteLine("libcups not found. To have printing support, you need cups installed"); -#endif return false; } @@ -124,11 +120,7 @@ namespace System.Drawing.Printing } catch (Exception) { -#if NETCORE System.Diagnostics.Debug.WriteLine("There was an error opening the printer {0}. Please check your cups installation."); -#else - Console.WriteLine("There was an error opening the printer {0}. Please check your cups installation."); -#endif } return IntPtr.Zero; } diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/SystemIcons.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/SystemIcons.Unix.cs index 0f180d2..b9a0e6b 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/SystemIcons.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/SystemIcons.Unix.cs @@ -46,7 +46,6 @@ namespace System.Drawing // we use an internal .ctor to ensure the SystemIcons can't de disposed private static readonly Icon[] icons = new Icon[6] { -#if NETCORE // TODO: Decide which icons to use for this. new Icon("placeholder.ico", undisposable:true), // Application_Winlogo new Icon("placeholder.ico", undisposable:true), // Asterisk_Information @@ -54,14 +53,6 @@ namespace System.Drawing new Icon("placeholder.ico", undisposable:true), // Exclamation_Warning new Icon("placeholder.ico", undisposable:true), // Question_ new Icon("placeholder.ico", undisposable:true), // Shield_ -#else - new Icon("Mono.ico", undisposable:true), // Application_Winlogo - new Icon("Information.ico", undisposable:true), // Asterisk_Information - new Icon("Error.ico", undisposable:true), // Error_Hand - new Icon("Warning.ico", undisposable:true), // Exclamation_Warning - new Icon("Question.ico", undisposable:true), // Question_ - new Icon("Shield.ico", undisposable:true), // Shield_ -#endif }; // note: same as WinLogo (for Mono) diff --git a/src/libraries/System.Globalization/tests/System/Globalization/CharUnicodeInfoTests.cs b/src/libraries/System.Globalization/tests/System/Globalization/CharUnicodeInfoTests.cs index 84fc413..1abde82 100644 --- a/src/libraries/System.Globalization/tests/System/Globalization/CharUnicodeInfoTests.cs +++ b/src/libraries/System.Globalization/tests/System/Globalization/CharUnicodeInfoTests.cs @@ -20,9 +20,9 @@ namespace System.Globalization.Tests } // Test the string overload for a surrogate pair or a single char GetUnicodeCategory(testCase.Utf32CodeValue, new UnicodeCategory[] { testCase.GeneralCategory }); -#if netcoreapp +#if NETCOREAPP Assert.Equal(testCase.GeneralCategory, CharUnicodeInfo.GetUnicodeCategory(testCase.CodePoint)); -#endif // netcoreapp +#endif } } diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeAwaitable.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeAwaitable.cs index 0d0b5ee..abbb768 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeAwaitable.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeAwaitable.cs @@ -19,7 +19,7 @@ namespace System.IO.Pipelines private SynchronizationContext? _synchronizationContext; private ExecutionContext? _executionContext; -#if !netstandard +#if !NETSTANDARD2_0 private CancellationToken CancellationToken => _cancellationTokenRegistration.Token; #else private CancellationToken _cancellationToken; @@ -35,7 +35,7 @@ namespace System.IO.Pipelines _cancellationTokenRegistration = default; _synchronizationContext = null; _executionContext = null; -#if netstandard +#if NETSTANDARD2_0 _cancellationToken = CancellationToken.None; #endif } @@ -54,7 +54,7 @@ namespace System.IO.Pipelines // Don't register if already completed, we would immediately unregistered in ObserveCancellation if (cancellationToken.CanBeCanceled && !IsCompleted) { -#if netstandard +#if NETSTANDARD2_0 _cancellationToken = cancellationToken; #endif _cancellationTokenRegistration = cancellationToken.UnsafeRegister(callback, state); @@ -166,7 +166,7 @@ namespace System.IO.Pipelines cancellationToken = CancellationToken; CancellationTokenRegistration cancellationTokenRegistration = _cancellationTokenRegistration; -#if netstandard +#if NETSTANDARD2_0 _cancellationToken = default; #endif _cancellationTokenRegistration = default; diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs index ab1025f..35541af 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs @@ -68,7 +68,7 @@ namespace System.IO.Pipelines return ReadAsyncInternal(new Memory(buffer, offset, count), cancellationToken).AsTask(); } -#if !netstandard +#if !NETSTANDARD2_0 public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) { return ReadAsyncInternal(buffer, cancellationToken); diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriterStream.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriterStream.cs index 56a3126..872e5cd 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriterStream.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriterStream.cs @@ -69,7 +69,7 @@ namespace System.IO.Pipelines return GetFlushResultAsTask(valueTask); } -#if !netstandard +#if !NETSTANDARD2_0 public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) { ValueTask valueTask = _pipeWriter.WriteAsync(buffer, cancellationToken); diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs index dcd2aa0..fc30232 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs @@ -237,7 +237,7 @@ namespace System.IO.Pipelines if (!_leaveOpen) { -#if !netstandard +#if !NETSTANDARD2_0 await InnerStream.DisposeAsync().ConfigureAwait(false); #else InnerStream.Dispose(); @@ -356,7 +356,7 @@ namespace System.IO.Pipelines if (returnSegment.Length > 0) { -#if !netstandard +#if !NETSTANDARD2_0 InnerStream.Write(returnSegment.Memory.Span); #else InnerStream.Write(returnSegment.Memory); diff --git a/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledReadsStream.cs b/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledReadsStream.cs index b4e703f..b134551 100644 --- a/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledReadsStream.cs +++ b/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledReadsStream.cs @@ -25,7 +25,7 @@ namespace System.IO.Pipelines.Tests return 0; } -#if netcoreapp +#if NETCOREAPP public override async ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) { await WaitForReadTask.Task; diff --git a/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledWritesStream.cs b/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledWritesStream.cs index 71a519b..7d02a54 100644 --- a/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledWritesStream.cs +++ b/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledWritesStream.cs @@ -24,7 +24,7 @@ namespace System.IO.Pipelines.Tests cancellationToken.ThrowIfCancellationRequested(); } -#if netcoreapp +#if NETCOREAPP public override async ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) { await WaitForWriteTask.Task; diff --git a/src/libraries/System.IO.Pipelines/tests/Infrastructure/ThrowAfterNWritesStream.cs b/src/libraries/System.IO.Pipelines/tests/Infrastructure/ThrowAfterNWritesStream.cs index 71acdae..50fa41c 100644 --- a/src/libraries/System.IO.Pipelines/tests/Infrastructure/ThrowAfterNWritesStream.cs +++ b/src/libraries/System.IO.Pipelines/tests/Infrastructure/ThrowAfterNWritesStream.cs @@ -33,7 +33,7 @@ namespace System.IO.Pipelines.Tests return Task.CompletedTask; } -#if netcoreapp +#if NETCOREAPP public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) { if (_writes >= _maxWrites) diff --git a/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs b/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs index 3807eef..74b22f9 100644 --- a/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs @@ -612,7 +612,7 @@ namespace System.IO.Pipelines.Tests { throw new OperationCanceledException(); } -#if netcoreapp +#if NETCOREAPP public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) { throw new OperationCanceledException(); @@ -647,7 +647,7 @@ namespace System.IO.Pipelines.Tests return bytes; } -#if netcoreapp +#if NETCOREAPP public override async ValueTask ReadAsync(Memory destination, CancellationToken cancellationToken = default) { if (_throwOnNextCallToRead) diff --git a/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs b/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs index e113d5e..c9c85d9 100644 --- a/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs @@ -573,7 +573,7 @@ namespace System.IO.Pipelines.Tests throw new OperationCanceledException(); } -#if netcoreapp +#if NETCOREAPP public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) { throw new OperationCanceledException(); diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Decompression.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Decompression.cs index cfe6f8a..792ce7e 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Decompression.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Decompression.cs @@ -192,7 +192,7 @@ namespace System.Net.Http.Functional.Tests } [Theory] -#if netcoreapp +#if NETCOREAPP [InlineData(DecompressionMethods.Brotli, "br", "")] [InlineData(DecompressionMethods.Brotli, "br", "br")] [InlineData(DecompressionMethods.Brotli, "br", "gzip")] diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.cs index fba216d..55d7330 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.cs @@ -105,7 +105,7 @@ namespace System.Net.Http.Functional.Tests } protected LoopbackServerFactory LoopbackServerFactory => -#if netcoreapp +#if NETCOREAPP UseHttp2 ? (LoopbackServerFactory)Http2LoopbackServerFactory.Singleton : #endif diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/PlatformHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/PlatformHandlerTest.cs index fbf0234..32c00aa 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/PlatformHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/PlatformHandlerTest.cs @@ -97,7 +97,7 @@ namespace System.Net.Http.Functional.Tests protected override bool UseSocketsHttpHandler => false; } -#if netcoreapp +#if NETCOREAPP public sealed class PlatformHandler_HttpClientHandler_Decompression_Tests : HttpClientHandler_Decompression_Test { public PlatformHandler_HttpClientHandler_Decompression_Tests(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/TestHelper.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/TestHelper.cs index 98ea27a..57e7980 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/TestHelper.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/TestHelper.cs @@ -102,7 +102,7 @@ namespace System.Net.Http.Functional.Tests return TaskTimeoutExtensions.WhenAllOrAnyFailed(tasks, timeoutInMilliseconds); } -#if netcoreapp +#if NETCOREAPP public static Func AllowAllCertificates = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; #else public static Func AllowAllCertificates = (_, __, ___, ____) => true; diff --git a/src/libraries/System.Net.WebSockets/tests/WebSocketTests.cs b/src/libraries/System.Net.WebSockets/tests/WebSocketTests.cs index 0af7500..19b7eb0 100644 --- a/src/libraries/System.Net.WebSockets/tests/WebSocketTests.cs +++ b/src/libraries/System.Net.WebSockets/tests/WebSocketTests.cs @@ -91,7 +91,7 @@ namespace System.Net.WebSockets.Tests Assert.Throws(() => WebSocket.RegisterPrefixes()); } -#if netcoreapp +#if NETCOREAPP [Fact] public static void IsApplicationTargeting45_AlwaysTrue() { @@ -99,7 +99,7 @@ namespace System.Net.WebSockets.Tests Assert.True(WebSocket.IsApplicationTargeting45()); #pragma warning restore 0618 } -#endif // netcoreapp +#endif [Theory] [InlineData(WebSocketState.None)] diff --git a/src/libraries/System.Reflection.DispatchProxy/tests/DispatchProxyTests.cs b/src/libraries/System.Reflection.DispatchProxy/tests/DispatchProxyTests.cs index 9856dc0..4c4dc85 100644 --- a/src/libraries/System.Reflection.DispatchProxy/tests/DispatchProxyTests.cs +++ b/src/libraries/System.Reflection.DispatchProxy/tests/DispatchProxyTests.cs @@ -397,7 +397,7 @@ namespace DispatchProxyTests Assert.NotNull(propertyInfo); } -#if netcoreapp +#if NETCOREAPP [Fact] public static void Invoke_Event_Add_And_Remove_And_Raise_Invokes_Correct_Methods() { @@ -445,7 +445,7 @@ namespace DispatchProxyTests Assert.True(invokedMethods[2] != null && expectedMethod == invokedMethods[2], String.Format("Third invoke should have been {0} but actual was {1}", expectedMethod.Name, invokedMethods[1])); } -#endif // netcoreapp +#endif [Fact] public static void Proxy_Declares_Interface_Events() diff --git a/src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.cs b/src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.cs index d82c0fe..8fd0fdb 100644 --- a/src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.cs +++ b/src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.cs @@ -101,7 +101,7 @@ namespace System.Reflection.Metadata public System.Reflection.Metadata.StringHandle Name { get { throw null; } } public System.Reflection.Metadata.BlobHandle PublicKey { get { throw null; } } public System.Version Version { get { throw null; } } -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 public System.Reflection.AssemblyName GetAssemblyName() { throw null; } #endif public System.Reflection.Metadata.CustomAttributeHandleCollection GetCustomAttributes() { throw null; } @@ -171,7 +171,7 @@ namespace System.Reflection.Metadata public System.Reflection.Metadata.StringHandle Name { get { throw null; } } public System.Reflection.Metadata.BlobHandle PublicKeyOrToken { get { throw null; } } public System.Version Version { get { throw null; } } -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 public System.Reflection.AssemblyName GetAssemblyName() { throw null; } #endif public System.Reflection.Metadata.CustomAttributeHandleCollection GetCustomAttributes() { throw null; } @@ -1256,7 +1256,7 @@ namespace System.Reflection.Metadata public partial class ImageFormatLimitationException : System.Exception { public ImageFormatLimitationException() { } -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 protected ImageFormatLimitationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } #endif public ImageFormatLimitationException(string message) { } diff --git a/src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.csproj b/src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.csproj index a8cdf1c..54327dd 100644 --- a/src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.csproj +++ b/src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.csproj @@ -2,7 +2,6 @@ true false - $(DefineConstants);NETSTANDARD11 netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;netstandard1.1-Debug;netstandard1.1-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release diff --git a/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj b/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj index 812e0a9..8181310 100644 --- a/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj +++ b/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj @@ -6,7 +6,6 @@ en-US false true - NETSTANDARD11 netstandard1.1;portable-net45+win8 netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;netstandard1.1-Debug;netstandard1.1-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/MemoryMappedFileBlock.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/MemoryMappedFileBlock.cs index f52f824..148e2a5 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/MemoryMappedFileBlock.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/MemoryMappedFileBlock.cs @@ -19,7 +19,7 @@ namespace System.Reflection.Internal public DisposableData(IDisposable accessor, SafeBuffer safeBuffer, long offset) { // Make sure the current thread isn't aborted in between acquiring the pointer and assigning the fields. -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 RuntimeHelpers.PrepareConstrainedRegions(); #endif try @@ -40,7 +40,7 @@ namespace System.Reflection.Internal { // Make sure the current thread isn't aborted in between zeroing the references and releasing/disposing. // Safe buffer only frees the underlying resource if its ref count drops to zero, so we have to make sure it does. -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 RuntimeHelpers.PrepareConstrainedRegions(); #endif try diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/NativeHeapMemoryBlock.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/NativeHeapMemoryBlock.cs index 0915014..f944457 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/NativeHeapMemoryBlock.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/NativeHeapMemoryBlock.cs @@ -23,7 +23,7 @@ namespace System.Reflection.Internal public DisposableData(int size) { // make sure the current thread isn't aborted in between allocating and storing the pointer -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 RuntimeHelpers.PrepareConstrainedRegions(); #endif try @@ -38,7 +38,7 @@ namespace System.Reflection.Internal protected override void Release() { // make sure the current thread isn't aborted in between zeroing the pointer and freeing the memory -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 RuntimeHelpers.PrepareConstrainedRegions(); #endif try diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/PinnedObject.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/PinnedObject.cs index 8eddfd7..47ca623 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/PinnedObject.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/PinnedObject.cs @@ -19,7 +19,7 @@ namespace System.Reflection.Internal public PinnedObject(object obj) { // Make sure the current thread isn't aborted in between allocating the handle and storing it. -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 RuntimeHelpers.PrepareConstrainedRegions(); #endif try @@ -35,7 +35,7 @@ namespace System.Reflection.Internal protected override void Release() { // Make sure the current thread isn't aborted in between zeroing the handle and freeing it. -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 RuntimeHelpers.PrepareConstrainedRegions(); #endif try diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/VirtualHeap.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/VirtualHeap.cs index 68e20f4..9cc4785 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/VirtualHeap.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/VirtualHeap.cs @@ -47,7 +47,7 @@ namespace System.Reflection.Metadata.Ecma335 protected override void Release() { // Make sure the current thread isn't aborted in the middle of the operation. -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 RuntimeHelpers.PrepareConstrainedRegions(); #endif try @@ -95,7 +95,7 @@ namespace System.Reflection.Metadata.Ecma335 var blobs = GetBlobs(); MemoryBlock result; -#if !NETSTANDARD11 +#if !NETSTANDARD1_1 RuntimeHelpers.PrepareConstrainedRegions(); #endif try diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/NetStandardBridge.cs b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/NetStandardBridge.cs index 19e9c98..8c41932 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/NetStandardBridge.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/NetStandardBridge.cs @@ -9,7 +9,7 @@ namespace System.Reflection.Tests { internal static class NetCoreApiEmulators { -#if netcoreapp +#if NETCOREAPP public static bool IsSZArray(this Type t) => t.IsSZArray; public static bool IsVariableBoundArray(this Type t) => t.IsVariableBoundArray; public static bool IsTypeDefinition(this Type t) => t.IsTypeDefinition; diff --git a/src/libraries/System.Reflection/tests/AssemblyTests.cs b/src/libraries/System.Reflection/tests/AssemblyTests.cs index 37441e2..e360a58 100644 --- a/src/libraries/System.Reflection/tests/AssemblyTests.cs +++ b/src/libraries/System.Reflection/tests/AssemblyTests.cs @@ -297,7 +297,7 @@ namespace System.Reflection.Tests var loadedAssembly1 = Assembly.LoadFile(fullRuntimeTestsPath); Assert.NotEqual(currentAssembly, loadedAssembly1); -#if netcoreapp +#if NETCOREAPP System.Runtime.Loader.AssemblyLoadContext alc = System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(loadedAssembly1); string expectedName = string.Format("Assembly.LoadFile({0})", fullRuntimeTestsPath); Assert.Equal(expectedName, alc.Name); diff --git a/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs b/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs index dbca320..0c54c4b 100644 --- a/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs +++ b/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs @@ -107,7 +107,7 @@ namespace System.Resources.Tests static int ResourcesAfAZEvents = 0; -#if netcoreapp +#if NETCOREAPP static System.Reflection.Assembly AssemblyResolvingEventHandler(System.Runtime.Loader.AssemblyLoadContext alc, System.Reflection.AssemblyName name) { if (name.FullName.StartsWith("System.Resources.ResourceManager.Tests.resources")) @@ -133,7 +133,7 @@ namespace System.Resources.Tests { if (name.Contains("Culture=af-ZA")) { -#if netcoreapp +#if NETCOREAPP Assert.Equal(1, ResourcesAfAZEvents); #else Assert.Equal(0, ResourcesAfAZEvents); @@ -158,7 +158,7 @@ namespace System.Resources.Tests private static void Remote_ExpectEvents() { -#if netcoreapp +#if NETCOREAPP System.Runtime.Loader.AssemblyLoadContext.Default.Resolving += AssemblyResolvingEventHandler; #endif AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(AssemblyResolveEventHandler); @@ -172,7 +172,7 @@ namespace System.Resources.Tests string actual = resourceManager.GetString("One", culture); Assert.Equal("Value-One", actual); -#if netcoreapp +#if NETCOREAPP Assert.Equal(2, ResourcesAfAZEvents); #else Assert.Equal(1, ResourcesAfAZEvents); diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SRef.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SRef.cs index 3725285..c5b124e 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SRef.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SRef.cs @@ -11,72 +11,6 @@ using System.Runtime.InteropServices; namespace System.Runtime.Caching { - // CoreClr 2.0 supports GC sized refs but does not expose System.SizedReference -#if NETCOREAPP21 - internal class SRef { - private static Type s_type = Type.GetType("System.SizedReference", true, false); - private Object _sizedRef; - - internal SRef(Object target) { - _sizedRef = Activator.CreateInstance(s_type, - BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.CreateInstance, - null, - new object[] { target }, - null); - } - - internal long ApproximateSize { - get { - object o = s_type.InvokeMember("ApproximateSize", - BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, - null, // binder - _sizedRef, // target - null, // args - CultureInfo.InvariantCulture); - return (long)o; - } - } - - internal void Dispose() { - s_type.InvokeMember("Dispose", - BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod, - null, // binder - _sizedRef, // target - null, // args - CultureInfo.InvariantCulture); - } - } - - internal class SRefMultiple { - private SRef[] _srefs; - private long[] _sizes; // Getting SRef size in the debugger is extremely tedious so we keep the last read value here - - internal SRefMultiple(object[] targets) { - _srefs = new SRef[targets.Length]; - _sizes = new long[targets.Length]; - for (int i = 0; i < targets.Length; i++) { - _srefs[i] = new SRef(targets[i]); - } - } - - internal long ApproximateSize { - get { - long size = 0; - for (int i = 0; i < _srefs.Length; i++) { - size += (_sizes[i] = _srefs[i].ApproximateSize); - } - return size; - } - } - - internal void Dispose() { - foreach (SRef s in _srefs) { - s.Dispose(); - } - } - } - -#else // until then we provide a stub internal class SRefMultiple { @@ -88,7 +22,6 @@ namespace System.Runtime.Caching { } } -#endif internal class GCHandleRef : IDisposable where T : class, IDisposable diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/StringMarshalingTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/StringMarshalingTests.cs index 4e47017..010a725 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/StringMarshalingTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/StringMarshalingTests.cs @@ -148,7 +148,7 @@ namespace System.Runtime.InteropServices.Tests } -#if netcoreapp +#if NETCOREAPP [Fact] public void TestUTF8String() { diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTestData.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTestData.cs index bf836a0..3e43f72 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTestData.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTestData.cs @@ -62,7 +62,7 @@ using System.Reflection.Metadata; using System.Diagnostics.Eventing.Reader; // System.Text.Json is a .NET Core 3.0 specific library -#if netcoreapp +#if NETCOREAPP using System.Text.Json; #endif @@ -495,7 +495,7 @@ namespace System.Runtime.Serialization.Formatters.Tests var isolatedStorageException = new IsolatedStorageException("message", exception); yield return new object[] { PopulateException(isolatedStorageException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netcoreapp20), new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) } }; -#if netcoreapp +#if NETCOREAPP var jsonException = new JsonException("message", path: "path", lineNumber: 1, bytePositionInLine: 2, innerException: exception); yield return new object[] { PopulateException(jsonException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAMAgAAAFNTeXN0ZW0uVGV4dC5Kc29uLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Y2M3YjEzZmZjZDJkZGQ1MQUBAAAAHlN5c3RlbS5UZXh0Lkpzb24uSnNvbkV4Y2VwdGlvbhAAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzCkxpbmVOdW1iZXISQnl0ZVBvc2l0aW9uSW5MaW5lBFBhdGgNQWN0dWFsTWVzc2FnZQEBAwMBAQEAAQABBwMDAQEpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgxTeXN0ZW0uSW50NjQMU3lzdGVtLkludDY0AgAAAAYDAAAAHlN5c3RlbS5UZXh0Lkpzb24uSnNvbkV4Y2VwdGlvbgYEAAAAB21lc3NhZ2UJBQAAAAkGAAAABgcAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYIAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBgkAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgoAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKCAkBAAAAAAAAAAgJAgAAAAAAAAAGCwAAAARwYXRoCQQAAAAEBQAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJDQAAAAIAAAACAAAABAYAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDgAAABBTeXN0ZW0uRXhjZXB0aW9uCQQAAAAJEAAAAAkRAAAACQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAKBA0AAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhYAAAAGc2VjcmV0CAEBCRcAAAABEAAAAAUAAAAJGAAAAAIAAAACAAAAAREAAAAGAAAACQ4AAAAGGgAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFwAAAA0AAAAICAEAAAAGGwAAAANvbmUKARgAAAANAAAACRYAAAAIAQEJHQAAAAEdAAAADQAAAAgIAQAAAAkbAAAACgs=", TargetFrameworkMoniker.netcoreapp30) } }; @@ -686,7 +686,7 @@ namespace System.Runtime.Serialization.Formatters.Tests var smtpFailedRecipientsException = new SmtpFailedRecipientsException("message", new SmtpFailedRecipientException[] { smtpFailedRecipientException }); yield return new object[] { PopulateException(smtpFailedRecipientsException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLk5ldC5NYWlsLlNtdHBGYWlsZWRSZWNpcGllbnRzRXhjZXB0aW9uDwAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMGU3RhdHVzD2ZhaWxlZFJlY2lwaWVudA9pbm5lckV4Y2VwdGlvbnMBAQMEAQEBAAEAAQcAAQQpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwsU3lzdGVtLk5ldC5NYWlsLlNtdHBGYWlsZWRSZWNpcGllbnRFeGNlcHRpb24CAAAACAgCCC5TeXN0ZW0uTmV0Lk1haWwuU210cEZhaWxlZFJlY2lwaWVudEV4Y2VwdGlvbltdAgAAAAIAAAAGAwAAAC1TeXN0ZW0uTmV0Lk1haWwuU210cEZhaWxlZFJlY2lwaWVudHNFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GCAAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYJAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYKAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCv////8GCwAAAA9mYWlsZWRSZWNpcGllbnQJDAAAAAQFAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkNAAAAAgAAAAIAAAAFBgAAACxTeXN0ZW0uTmV0Lk1haWwuU210cEZhaWxlZFJlY2lwaWVudEV4Y2VwdGlvbg4AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzBlN0YXR1cw9mYWlsZWRSZWNpcGllbnQBAQMDAQEBAAEAAQcAASlTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCCAIAAAAGDgAAACxTeXN0ZW0uTmV0Lk1haWwuU210cEZhaWxlZFJlY2lwaWVudEV4Y2VwdGlvbgYPAAAAMkNvbXBsZXRlZC4gVGhlIHNlcnZlciByZXNwb25zZSB3YXM6IHNlcnZlclJlc3BvbnNlCRAAAAAKCQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAK+gAAAAkLAAAABwwAAAAAAQAAAAEAAAAELFN5c3RlbS5OZXQuTWFpbC5TbXRwRmFpbGVkUmVjaXBpZW50RXhjZXB0aW9uAgAAAAkGAAAABA0AAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhcAAAAGc2VjcmV0CAEBCRgAAAABEAAAAAUAAAAJGQAAAAIAAAACAAAAARgAAAANAAAACAgBAAAABhoAAAADb25lCgEZAAAADQAAAAkXAAAACAEBCRwAAAABHAAAAA0AAAAICAEAAAAJGgAAAAoL", TargetFrameworkMoniker.netcoreapp20), new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAtU3lzdGVtLk5ldC5NYWlsLlNtdHBGYWlsZWRSZWNpcGllbnRzRXhjZXB0aW9uDwAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMGU3RhdHVzD2ZhaWxlZFJlY2lwaWVudA9pbm5lckV4Y2VwdGlvbnMBAQMEAQEBAAEAAQcAAQQpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwsU3lzdGVtLk5ldC5NYWlsLlNtdHBGYWlsZWRSZWNpcGllbnRFeGNlcHRpb24CAAAACAgCCC5TeXN0ZW0uTmV0Lk1haWwuU210cEZhaWxlZFJlY2lwaWVudEV4Y2VwdGlvbltdAgAAAAIAAAAGAwAAAC1TeXN0ZW0uTmV0Lk1haWwuU210cEZhaWxlZFJlY2lwaWVudHNFeGNlcHRpb24GBAAAAAdtZXNzYWdlCQUAAAAJBgAAAAYHAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GCAAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYJAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYKAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCv////8GCwAAAA9mYWlsZWRSZWNpcGllbnQJDAAAAAQFAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkNAAAAAgAAAAIAAAAFBgAAACxTeXN0ZW0uTmV0Lk1haWwuU210cEZhaWxlZFJlY2lwaWVudEV4Y2VwdGlvbg4AAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzBlN0YXR1cw9mYWlsZWRSZWNpcGllbnQBAQMDAQEBAAEAAQcAASlTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCCAIAAAAGDgAAACxTeXN0ZW0uTmV0Lk1haWwuU210cEZhaWxlZFJlY2lwaWVudEV4Y2VwdGlvbgYPAAAAMkNvbXBsZXRlZC4gVGhlIHNlcnZlciByZXNwb25zZSB3YXM6IHNlcnZlclJlc3BvbnNlCRAAAAAKCQcAAAAJCAAAAAkJAAAAAAAAAAroAwAACQoAAAAK+gAAAAkLAAAABwwAAAAAAQAAAAEAAAAELFN5c3RlbS5OZXQuTWFpbC5TbXRwRmFpbGVkUmVjaXBpZW50RXhjZXB0aW9uAgAAAAkGAAAABA0AAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhcAAAAGc2VjcmV0CAEBCRgAAAABEAAAAAUAAAAJGQAAAAIAAAACAAAAARgAAAANAAAACAgBAAAABhoAAAADb25lCgEZAAAADQAAAAkXAAAACAEBCRwAAAABHAAAAA0AAAAICAEAAAAJGgAAAAoL", TargetFrameworkMoniker.netfx461) } }; -#if netcoreapp +#if NETCOREAPP var ambiguousImplementationException = new AmbiguousImplementationException(); yield return new object[] { PopulateException(ambiguousImplementationException, false), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uUnVudGltZSwgVmVyc2lvbj00LjIuMS4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAAC9TeXN0ZW0uUnVudGltZS5BbWJpZ3VvdXNJbXBsZW1lbnRhdGlvbkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAICAAAABgMAAAAvU3lzdGVtLlJ1bnRpbWUuQW1iaWd1b3VzSW1wbGVtZW50YXRpb25FeGNlcHRpb24GBAAAAB9BbWJpZ3VvdXMgaW1wbGVtZW50YXRpb24gZm91bmQuCQUAAAAKBgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAApqEBOABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAUAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYLAAAABnNlY3JldAgBAQkMAAAAAQwAAAAKAAAACAgBAAAABg0AAAADb25lCgs=", TargetFrameworkMoniker.netcoreapp30) } }; var switchExpressionException = new SwitchExpressionException(34); diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/EqualityExtensions.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/EqualityExtensions.cs index cd6ef43..a555658 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/EqualityExtensions.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/EqualityExtensions.cs @@ -26,7 +26,7 @@ using System.Threading; using Xunit; // System.Text.Json is a .NET Core 3.0 specific library -#if netcoreapp +#if NETCOREAPP using System.Text.Json; #endif @@ -1204,7 +1204,7 @@ namespace System.Runtime.Serialization.Formatters.Tests @this.InnerExceptions.CheckSequenceEquals(other.InnerExceptions, isSamePlatform); } -#if netcoreapp +#if NETCOREAPP public static void IsEqual(this JsonException @this, JsonException other, bool isSamePlatform) { if (@this == null && other == null) diff --git a/src/libraries/System.Runtime.WindowsRuntime/src/System/Resources/WindowsRuntimeResourceManager.cs b/src/libraries/System.Runtime.WindowsRuntime/src/System/Resources/WindowsRuntimeResourceManager.cs index fd4d274..7032ef3 100644 --- a/src/libraries/System.Runtime.WindowsRuntime/src/System/Resources/WindowsRuntimeResourceManager.cs +++ b/src/libraries/System.Runtime.WindowsRuntime/src/System/Resources/WindowsRuntimeResourceManager.cs @@ -273,7 +273,7 @@ namespace System.Resources (libpath[packagepath.Length] == '\\' || packagepath.EndsWith("\\")); } -#if netstandard +#if NETSTANDARD2_0 /* Returns true if libpath is path to an ni image and if the path contains packagename as a subfolder */ private static bool LibpathContainsPackagename(string libpath, string packagename) { @@ -305,7 +305,7 @@ namespace System.Resources } } -#if netstandard +#if NETSTANDARD2_0 /* On phone libpath is usually ni path and not IL path as we do not touch the IL on phone. On Phone NI images are no longer under package root. Due to this above logic fails to find the package to which the library belongs. We assume that NI paths usually have @@ -363,7 +363,7 @@ namespace System.Resources { string packageSimpleName = FindPackageSimpleNameForFilename(libpath); -#if netstandard +#if NETSTANDARD2_0 // If we have found a simple package name for the assembly, lets make sure it is not *.resource.dll that // an application may have packaged in its AppX. This is to enforce AppX apps to use PRI resources. if (packageSimpleName != null) @@ -376,7 +376,7 @@ namespace System.Resources packageSimpleName = null; } } -#endif // netstandard +#endif if (packageSimpleName != null) { ResourceMap packageResourceMap = null; diff --git a/src/libraries/System.Runtime/tests/System/ActivatorTests.cs b/src/libraries/System.Runtime/tests/System/ActivatorTests.cs index 698d95a..a32ac63 100644 --- a/src/libraries/System.Runtime/tests/System/ActivatorTests.cs +++ b/src/libraries/System.Runtime/tests/System/ActivatorTests.cs @@ -119,7 +119,7 @@ namespace System.Tests Assert.Throws(() => Activator.CreateInstance(typeof(Choice1), new object[] { null })); } -#if netcoreapp +#if NETCOREAPP [Fact] public void CreateInstance_NotRuntimeType_ThrowsArgumentException() { @@ -130,7 +130,7 @@ namespace System.Tests AssertExtensions.Throws("type", () => Activator.CreateInstance(nonRuntimeType, new object[0])); } } -#endif // netcoreapp +#endif public static IEnumerable CreateInstance_ContainsGenericParameters_TestData() { diff --git a/src/libraries/System.Runtime/tests/System/EnumTests.cs b/src/libraries/System.Runtime/tests/System/EnumTests.cs index 51b86c1..ca353e2 100644 --- a/src/libraries/System.Runtime/tests/System/EnumTests.cs +++ b/src/libraries/System.Runtime/tests/System/EnumTests.cs @@ -77,7 +77,7 @@ namespace System.Tests yield return new object[] { ulong.MinValue.ToString(), false, (UInt64Enum)ulong.MinValue }; yield return new object[] { ulong.MaxValue.ToString(), false, (UInt64Enum)ulong.MaxValue }; -#if netcoreapp +#if NETCOREAPP // Char yield return new object[] { "Value1", false, Enum.ToObject(s_charEnumType, (char)1) }; yield return new object[] { "vaLue2", true, Enum.ToObject(s_charEnumType, (char)2) }; @@ -97,7 +97,7 @@ namespace System.Tests yield return new object[] { "Value1", false, Enum.GetValues(s_doubleEnumType).GetValue(0) }; yield return new object[] { "vaLue2", true, Enum.GetValues(s_doubleEnumType).GetValue(0) }; } -#endif // netcoreapp +#endif // SimpleEnum yield return new object[] { "Red", false, SimpleEnum.Red }; @@ -186,7 +186,7 @@ namespace System.Tests yield return new object[] { typeof(UInt64Enum), "-1", false, typeof(OverflowException) }; yield return new object[] { typeof(UInt64Enum), "18446744073709551616", false, typeof(OverflowException) }; -#if netcoreapp +#if NETCOREAPP // Char yield return new object[] { s_charEnumType, ((char)1).ToString(), false, typeof(ArgumentException) }; yield return new object[] { s_charEnumType, ((char)5).ToString(), false, typeof(ArgumentException) }; @@ -212,7 +212,7 @@ namespace System.Tests // UIntPtr yield return new object[] { s_uintPtrEnumType, "1", false, typeof(InvalidCastException) }; yield return new object[] { s_uintPtrEnumType, "5", false, typeof(InvalidCastException) }; -#endif // netcoreapp +#endif } [Theory] @@ -335,7 +335,7 @@ namespace System.Tests yield return new object[] { typeof(UInt64Enum), ulong.MaxValue, "Max" }; yield return new object[] { typeof(UInt64Enum), 3UL, null }; -#if netcoreapp +#if NETCOREAPP // Char yield return new object[] { s_charEnumType, Enum.Parse(s_charEnumType, "Value1"), "Value1" }; yield return new object[] { s_charEnumType, Enum.Parse(s_charEnumType, "Value2"), "Value2" }; @@ -348,7 +348,7 @@ namespace System.Tests yield return new object[] { s_boolEnumType, Enum.Parse(s_boolEnumType, "Value2"), "Value2" }; yield return new object[] { s_boolEnumType, true, "Value1" }; yield return new object[] { s_boolEnumType, false, "Value2" }; -#endif // netcoreapp +#endif } [Theory] @@ -494,7 +494,7 @@ namespace System.Tests yield return new object[] { typeof(UInt64Enum), (ulong)1, true }; yield return new object[] { typeof(UInt64Enum), (ulong)99, false }; -#if netcoreapp +#if NETCOREAPP // Char yield return new object[] { s_charEnumType, "Value1", true }; yield return new object[] { s_charEnumType, "None", false }; @@ -509,7 +509,7 @@ namespace System.Tests yield return new object[] { s_boolEnumType, "Value1", true }; yield return new object[] { s_boolEnumType, true, true }; yield return new object[] { s_boolEnumType, false, true }; -#endif // netcoreapp +#endif } [Theory] @@ -613,7 +613,7 @@ namespace System.Tests yield return new object[] { (UInt64Enum)0x3f06, (UInt64Enum)0x0010, false }; yield return new object[] { (UInt64Enum)0x3f06, (UInt64Enum)0x3f16, false }; -#if netcoreapp +#if NETCOREAPP // Char yield return new object[] { Enum.Parse(s_charEnumType, "Value0x3f06"), Enum.Parse(s_charEnumType, "Value0x3000"), true }; yield return new object[] { Enum.Parse(s_charEnumType, "Value0x3f06"), Enum.Parse(s_charEnumType, "Value0x0f06"), true }; @@ -664,7 +664,7 @@ namespace System.Tests yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 0x3f06), Enum.ToObject(s_uintPtrEnumType, 0x3f06), true }; yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 0x3f06), Enum.ToObject(s_uintPtrEnumType, 0x0010), false }; yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 0x3f06), Enum.ToObject(s_uintPtrEnumType, 0x3f16), false }; -#endif // netcoreapp +#endif } [Theory] @@ -729,7 +729,7 @@ namespace System.Tests yield return new object[] { typeof(UInt64Enum), (ulong)77, (UInt64Enum)77 }; yield return new object[] { typeof(UInt64Enum), (ulong)0x0123456789abcdefL, (UInt64Enum)0x0123456789abcdefL }; -#if netcoreapp +#if NETCOREAPP // Char yield return new object[] { s_charEnumType, (char)1, Enum.Parse(s_charEnumType, "Value1") }; yield return new object[] { s_charEnumType, (char)2, Enum.Parse(s_charEnumType, "Value2") }; @@ -737,7 +737,7 @@ namespace System.Tests // Bool yield return new object[] { s_boolEnumType, true, Enum.Parse(s_boolEnumType, "Value1") }; yield return new object[] { s_boolEnumType, false, Enum.Parse(s_boolEnumType, "Value2") }; -#endif // netcoreapp +#endif } [Theory] @@ -752,9 +752,9 @@ namespace System.Tests yield return new object[] { null, typeof(ArgumentNullException) }; yield return new object[] { typeof(Enum), typeof(ArgumentException) }; yield return new object[] { typeof(object), typeof(ArgumentException) }; -#if netcoreapp +#if NETCOREAPP yield return new object[] { GetNonRuntimeEnumTypeBuilder(typeof(int)), typeof(ArgumentException) }; -#endif // netcoreapp +#endif } [Theory] @@ -777,12 +777,12 @@ namespace System.Tests { yield return new object[] { typeof(SimpleEnum), null, typeof(ArgumentNullException) }; yield return new object[] { typeof(SimpleEnum), "Hello", typeof(ArgumentException) }; -#if netcoreapp +#if NETCOREAPP yield return new object[] { s_floatEnumType, 1.0f, typeof(ArgumentException) }; yield return new object[] { s_doubleEnumType, 1.0, typeof(ArgumentException) }; yield return new object[] { s_intPtrEnumType, (IntPtr)1, typeof(ArgumentException) }; yield return new object[] { s_uintPtrEnumType, (UIntPtr)1, typeof(ArgumentException) }; -#endif // netcoreapp +#endif } [Theory] @@ -863,7 +863,7 @@ namespace System.Tests yield return new object[] { UInt64Enum.One, new object(), false }; yield return new object[] { UInt64Enum.One, null, false }; -#if netcoreapp +#if NETCOREAPP // Char yield return new object[] { Enum.Parse(s_charEnumType, "Value1"), Enum.Parse(s_charEnumType, "Value1"), true }; yield return new object[] { Enum.Parse(s_charEnumType, "Value1"), Enum.Parse(s_charEnumType, "Value2"), false }; @@ -911,7 +911,7 @@ namespace System.Tests yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 1), (UIntPtr)1, false }; yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 1), new object(), false }; yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 1), null, false }; -#endif // netcoreapp +#endif } [Theory] @@ -973,7 +973,7 @@ namespace System.Tests yield return new object[] { UInt64Enum.One, UInt64Enum.Max, -1 }; yield return new object[] { UInt64Enum.One, null, 1 }; -#if netcoreapp +#if NETCOREAPP // Char yield return new object[] { Enum.Parse(s_charEnumType, "Value2"), Enum.Parse(s_charEnumType, "Value2"), 0 }; yield return new object[] { Enum.Parse(s_charEnumType, "Value2"), Enum.Parse(s_charEnumType, "Value1"), 1 }; @@ -1009,7 +1009,7 @@ namespace System.Tests yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 1), Enum.ToObject(s_uintPtrEnumType, 2), -1 }; yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 3), Enum.ToObject(s_uintPtrEnumType, 2), 1 }; yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 1), null, 1 }; -#endif // netcoreapp +#endif } [Theory] @@ -1036,14 +1036,14 @@ namespace System.Tests yield return new object[] { typeof(UInt32Enum), typeof(uint) }; yield return new object[] { typeof(Int64Enum), typeof(long) }; yield return new object[] { typeof(UInt64Enum), typeof(ulong) }; -#if netcoreapp +#if NETCOREAPP yield return new object[] { s_charEnumType, typeof(char) }; yield return new object[] { s_boolEnumType, typeof(bool) }; yield return new object[] { s_floatEnumType, typeof(float) }; yield return new object[] { s_doubleEnumType, typeof(double) }; yield return new object[] { s_intPtrEnumType, typeof(IntPtr) }; yield return new object[] { s_uintPtrEnumType, typeof(UIntPtr) }; -#endif // netcoreapp +#endif } [Theory] @@ -1134,7 +1134,7 @@ namespace System.Tests new object[] { UInt64Enum.Min, UInt64Enum.One, UInt64Enum.Two, UInt64Enum.Max } }; -#if netcoreapp +#if NETCOREAPP // Char yield return new object[] { @@ -1182,7 +1182,7 @@ namespace System.Tests new string[0], new object[0] }; -#endif // netcoreapp +#endif } [Theory] @@ -1277,7 +1277,7 @@ namespace System.Tests yield return new object[] { (UInt64Enum)99, "D", "99" }; yield return new object[] { UInt64Enum.Max, "D", "18446744073709551615" }; -#if netcoreapp +#if NETCOREAPP // "D": Char yield return new object[] { Enum.ToObject(s_charEnumType, (char)0), "D", ((char)0).ToString() }; yield return new object[] { Enum.ToObject(s_charEnumType, (char)1), "D", ((char)1).ToString() }; @@ -1298,7 +1298,7 @@ namespace System.Tests yield return new object[] { Enum.ToObject(s_doubleEnumType, 0), "D", "0" }; yield return new object[] { Enum.ToObject(s_doubleEnumType, 1), "D", double.Epsilon.ToString() }; yield return new object[] { Enum.ToObject(s_doubleEnumType, long.MaxValue), "D", double.NaN.ToString() }; -#endif // netcoreapp +#endif // "D": SimpleEnum yield return new object[] { SimpleEnum.Red, "D", "1" }; @@ -1359,7 +1359,7 @@ namespace System.Tests yield return new object[] { (UInt64Enum)99, "X", "0000000000000063" }; yield return new object[] { UInt64Enum.Max, "X", "FFFFFFFFFFFFFFFF" }; -#if netcoreapp +#if NETCOREAPP // "X": Char yield return new object[] { Enum.ToObject(s_charEnumType, (char)0), "X", "0000" }; yield return new object[] { Enum.ToObject(s_charEnumType, (char)1), "X", "0001" }; @@ -1371,7 +1371,7 @@ namespace System.Tests yield return new object[] { Enum.ToObject(s_boolEnumType, false), "X", "00" }; yield return new object[] { Enum.ToObject(s_boolEnumType, true), "X", "01" }; yield return new object[] { Enum.ToObject(s_boolEnumType, 123), "X", "01" }; -#endif // netcoreapp +#endif // "X": SimpleEnum yield return new object[] { SimpleEnum.Red, "X", "00000001" }; @@ -1424,7 +1424,7 @@ namespace System.Tests yield return new object[] { (UInt64Enum)5, "F", "5" }; yield return new object[] { UInt64Enum.Max, "F", "Max" }; -#if netcoreapp +#if NETCOREAPP // "F": Char yield return new object[] { Enum.ToObject(s_charEnumType, (char)1), "F", "Value1" }; yield return new object[] { Enum.ToObject(s_charEnumType, (char)(1 | 2)), "F", "Value1, Value2" }; @@ -1440,7 +1440,7 @@ namespace System.Tests // "F": UIntPtr yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 5), "F", "5" }; -#endif // netcoreapp +#endif // "F": SimpleEnum yield return new object[] { SimpleEnum.Red, "F", "Red" }; @@ -1451,7 +1451,7 @@ namespace System.Tests // "F": Flags Attribute yield return new object[] { AttributeTargets.Class | AttributeTargets.Delegate, "F", "Class, Delegate" }; -#if netcoreapp +#if NETCOREAPP // "G": Char yield return new object[] { Enum.ToObject(s_charEnumType, char.MaxValue), "G", char.MaxValue.ToString() }; #endif diff --git a/src/libraries/System.Runtime/tests/System/EnumTests.netcoreapp.cs b/src/libraries/System.Runtime/tests/System/EnumTests.netcoreapp.cs index 7030a84..51fd0f5 100644 --- a/src/libraries/System.Runtime/tests/System/EnumTests.netcoreapp.cs +++ b/src/libraries/System.Runtime/tests/System/EnumTests.netcoreapp.cs @@ -74,14 +74,14 @@ namespace System.Tests public static IEnumerable UnsupportedEnumType_TestData() { -#if netcoreapp +#if NETCOREAPP yield return new object[] { s_floatEnumType, 1.0f }; yield return new object[] { s_doubleEnumType, 1.0 }; yield return new object[] { s_intPtrEnumType, (IntPtr)1 }; yield return new object[] { s_uintPtrEnumType, (UIntPtr)1 }; #else return Array.Empty(); -#endif //netcoreapp +#endif } [Theory] @@ -102,14 +102,14 @@ namespace System.Tests public static IEnumerable UnsupportedEnum_TestData() { -#if netcoreapp +#if NETCOREAPP yield return new object[] { Enum.ToObject(s_floatEnumType, 1) }; yield return new object[] { Enum.ToObject(s_doubleEnumType, 2) }; yield return new object[] { Enum.ToObject(s_intPtrEnumType, 1) }; yield return new object[] { Enum.ToObject(s_uintPtrEnumType, 2) }; #else return Array.Empty(); -#endif //netcoreapp +#endif } [Theory] diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultDSAProvider.cs b/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultDSAProvider.cs index ad29060..a770eb2 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultDSAProvider.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultDSAProvider.cs @@ -13,7 +13,7 @@ namespace System.Security.Cryptography.Dsa.Tests public DSA Create(int keySize) { -#if netcoreapp +#if NETCOREAPP return DSA.Create(keySize); #else DSA dsa = Create(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.cs b/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.cs index c4a5ad5..76a6a00 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.cs @@ -20,7 +20,7 @@ namespace System.Security.Cryptography.EcDsa.Tests return ec; } -#if netcoreapp +#if NETCOREAPP public ECDsa Create(ECCurve curve) { return ECDsa.Create(curve); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultRSAProvider.cs b/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultRSAProvider.cs index a1ee143..d097dba 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultRSAProvider.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultRSAProvider.cs @@ -14,7 +14,7 @@ namespace System.Security.Cryptography.Rsa.Tests public RSA Create(int keySize) { -#if netcoreapp +#if NETCOREAPP return RSA.Create(keySize); #else RSA rsa = Create(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs b/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs index 3117652..c1d8962 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs @@ -82,7 +82,7 @@ namespace System.Security.Cryptography.DeriveBytesTests Assert.Throws(() => new Rfc2898DeriveBytes(TestPassword, s_testSalt, int.MinValue / 2)); } -#if netcoreapp +#if NETCOREAPP [Fact] public static void Ctor_EmptyAlgorithm() { @@ -345,7 +345,7 @@ namespace System.Security.Cryptography.DeriveBytesTests }); } -#if netcoreapp +#if NETCOREAPP [Theory] [MemberData(nameof(KnownValuesTestCases))] public static void GetBytes_KnownValues_WithAlgorithm(KnownValuesTestCase testCase) diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/ECDiffieHellmanCngProvider.cs b/src/libraries/System.Security.Cryptography.Cng/tests/ECDiffieHellmanCngProvider.cs index 67c5d7b..1942f26 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/ECDiffieHellmanCngProvider.cs +++ b/src/libraries/System.Security.Cryptography.Cng/tests/ECDiffieHellmanCngProvider.cs @@ -16,7 +16,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests return new ECDiffieHellmanCng(keySize); } -#if netcoreapp +#if NETCOREAPP public ECDiffieHellman Create(ECCurve curve) { return new ECDiffieHellmanCng(curve); diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/ECDiffieHellmanCngTests.cs b/src/libraries/System.Security.Cryptography.Cng/tests/ECDiffieHellmanCngTests.cs index aea48b4..8d805a4 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/ECDiffieHellmanCngTests.cs +++ b/src/libraries/System.Security.Cryptography.Cng/tests/ECDiffieHellmanCngTests.cs @@ -14,7 +14,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests return new ECDiffieHellmanCng(); } -#if netcoreapp +#if NETCOREAPP [Fact] public static void ECCurve_ctor() { diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngImportExportTests.cs b/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngImportExportTests.cs index 0822623..403f1ba 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngImportExportTests.cs +++ b/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngImportExportTests.cs @@ -47,7 +47,7 @@ namespace System.Security.Cryptography.Cng.Tests } } -#if netcoreapp +#if NETCOREAPP [ConditionalTheory(nameof(ECExplicitCurvesSupported)), MemberData(nameof(TestCurves))] public static void TestHashRoundTrip(CurveDef curveDef) { @@ -70,6 +70,6 @@ namespace System.Security.Cryptography.Cng.Tests Assert.Equal(0xFF, param2.Curve.Seed[0]); } } -#endif // netcoreapp +#endif } } diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngProvider.cs b/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngProvider.cs index fcc4eec..b0dc502 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngProvider.cs +++ b/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngProvider.cs @@ -16,7 +16,7 @@ namespace System.Security.Cryptography.EcDsa.Tests return new ECDsaCng(keySize); } -#if netcoreapp +#if NETCOREAPP public ECDsa Create(ECCurve curve) { return new ECDsaCng(curve); diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngTests.cs b/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngTests.cs index eeb7308..40b0cc2 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngTests.cs +++ b/src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngTests.cs @@ -157,7 +157,7 @@ namespace System.Security.Cryptography.Cng.Tests Assert.Equal(CngAlgorithm.Sha256, cng.HashAlgorithm); } -#if netcoreapp +#if NETCOREAPP [Fact] public static void TestPositive256WithBlob() { @@ -212,7 +212,7 @@ namespace System.Security.Cryptography.Cng.Tests Assert.Equal(algorithm, cng.Key.Algorithm); } } -#endif // netcoreapp +#endif public static IEnumerable SpecialNistKeys { diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/HandleTests.cs b/src/libraries/System.Security.Cryptography.Cng/tests/HandleTests.cs index 23ad115..e47a64c 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/HandleTests.cs +++ b/src/libraries/System.Security.Cryptography.Cng/tests/HandleTests.cs @@ -37,7 +37,7 @@ namespace System.Security.Cryptography.Cng.Tests } } -#if netcoreapp +#if NETCOREAPP [Fact] public static void SafeNCryptKeyHandle_ParentHandle_Invalid() { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.KeyTrans.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.KeyTrans.cs index 40a82d9..a9d15ea 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.KeyTrans.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.KeyTrans.cs @@ -189,7 +189,7 @@ namespace Internal.Cryptography.Pal.AnyOS return null; } -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 byte[] cek = null; int cekLength = 0; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs index cb63de1..2d64217 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs @@ -75,7 +75,7 @@ namespace Internal.Cryptography.Pal.AnyOS return (T)(object)certificate.GetRSAPrivateKey(); if (typeof(T) == typeof(ECDsa)) return (T)(object)certificate.GetECDsaPrivateKey(); -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 if (typeof(T) == typeof(DSA)) return (T)(object)certificate.GetDSAPrivateKey(); #endif diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs index 486a628..89ceedc 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs @@ -22,7 +22,7 @@ namespace Internal.Cryptography { private static readonly byte[] s_pSpecifiedDefaultParameters = { 0x04, 0x00 }; -#if !netcoreapp && !netcoreapp30 && !netstandard21 +#if !NETCOREAPP && !NETSTANDARD2_1 // Compatibility API. internal static void AppendData(this IncrementalHash hasher, ReadOnlySpan data) { @@ -324,7 +324,7 @@ namespace Internal.Cryptography return ToUpperHexString(serialBytes); } -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 private static unsafe string ToUpperHexString(ReadOnlySpan ba) { fixed (byte* baPtr = ba) @@ -416,7 +416,7 @@ namespace Internal.Cryptography attributeObject = Upgrade(attributeObject); break; -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 case Oids.LocalKeyId: attributeObject = Upgrade(attributeObject); break; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsRecipient.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsRecipient.cs index 6904cb7..56c2f81 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsRecipient.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsRecipient.cs @@ -15,7 +15,7 @@ namespace System.Security.Cryptography.Pkcs { } -#if netstandard +#if NETSTANDARD2_0 internal #else public @@ -27,7 +27,7 @@ namespace System.Security.Cryptography.Pkcs RSAEncryptionPadding = rsaEncryptionPadding ?? throw new ArgumentNullException(nameof(rsaEncryptionPadding)); } -#if netstandard +#if NETSTANDARD2_0 internal #else public @@ -61,7 +61,7 @@ namespace System.Security.Cryptography.Pkcs Certificate = certificate; } -#if netstandard +#if NETSTANDARD2_0 internal #else public diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.DSA.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.DSA.cs index 1cead24..e4b23c1 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.DSA.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.DSA.cs @@ -37,7 +37,7 @@ namespace System.Security.Cryptography.Pkcs } internal override bool VerifySignature( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -68,7 +68,7 @@ namespace System.Security.Cryptography.Pkcs DSAParameters dsaParameters = dsa.ExportParameters(false); int bufSize = 2 * dsaParameters.Q.Length; -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 byte[] rented = CryptoPool.Rent(bufSize); Span ieee = new Span(rented, 0, bufSize); @@ -83,7 +83,7 @@ namespace System.Security.Cryptography.Pkcs } return dsa.VerifySignature(valueHash, ieee); -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 } finally { @@ -93,7 +93,7 @@ namespace System.Security.Cryptography.Pkcs } protected override bool Sign( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -133,7 +133,7 @@ namespace System.Security.Cryptography.Pkcs signatureAlgorithm = new Oid(oidValue, oidValue); -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 // The Q size cannot be bigger than the KeySize. byte[] rented = CryptoPool.Rent(dsa.KeySize / 8); int bytesWritten = 0; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs index f50e76b..7ba8e50 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs @@ -37,7 +37,7 @@ namespace System.Security.Cryptography.Pkcs } internal override bool VerifySignature( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -73,7 +73,7 @@ namespace System.Security.Cryptography.Pkcs bufSize = 2 * fieldSize; } -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 byte[] rented = CryptoPool.Rent(bufSize); Span ieee = new Span(rented, 0, bufSize); @@ -88,7 +88,7 @@ namespace System.Security.Cryptography.Pkcs } return key.VerifyHash(valueHash, ieee); -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 } finally { @@ -98,7 +98,7 @@ namespace System.Security.Cryptography.Pkcs } protected override bool Sign( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -138,7 +138,7 @@ namespace System.Security.Cryptography.Pkcs signatureAlgorithm = new Oid(oidValue, oidValue); -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 int bufSize; checked { @@ -174,7 +174,7 @@ namespace System.Security.Cryptography.Pkcs #endif signatureValue = DsaIeeeToDer(key.SignHash( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 dataHash.ToArray() #else dataHash diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.RSA.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.RSA.cs index 3f931d0..59cf00c 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.RSA.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.RSA.cs @@ -40,7 +40,7 @@ namespace System.Security.Cryptography.Pkcs } internal override bool VerifySignature( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -76,7 +76,7 @@ namespace System.Security.Cryptography.Pkcs return publicKey.VerifyHash( valueHash, -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 signature.Span, #else signature, @@ -123,7 +123,7 @@ namespace System.Security.Cryptography.Pkcs } protected override bool Sign( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -151,7 +151,7 @@ namespace System.Security.Cryptography.Pkcs signatureAlgorithm = new Oid(Oids.Rsa, Oids.Rsa); -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 byte[] signature = new byte[privateKey.KeySize / 8]; bool signed = privateKey.TrySignHash( @@ -176,7 +176,7 @@ namespace System.Security.Cryptography.Pkcs } #endif signatureValue = privateKey.SignHash( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 dataHash.ToArray(), #else dataHash, @@ -267,7 +267,7 @@ namespace System.Security.Cryptography.Pkcs } protected override bool Sign( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.cs index ec8ba00..4bec2a4 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.cs @@ -29,7 +29,7 @@ namespace System.Security.Cryptography.Pkcs protected abstract bool VerifyKeyType(AsymmetricAlgorithm key); internal abstract bool VerifySignature( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -42,7 +42,7 @@ namespace System.Security.Cryptography.Pkcs X509Certificate2 certificate); protected abstract bool Sign( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -70,7 +70,7 @@ namespace System.Security.Cryptography.Pkcs } internal static bool Sign( -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -167,7 +167,7 @@ namespace System.Security.Cryptography.Pkcs { writer.PushSequence(); -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 // r BigInteger val = new BigInteger( ieeeSignature.Slice(0, fieldSize), diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs index f44b167e..18f1ca9 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs @@ -51,7 +51,7 @@ namespace System.Security.Cryptography.Pkcs { } - // This can be implemented with netcoreapp20 with the cert creation API. + // This can be implemented with NETCOREAPP2_0 with the cert creation API. // * Open the parameters as RSACSP (RSA PKCS#1 signature was hard-coded in netfx) // * Which will fail on non-Windows // * Create a certificate with subject CN=CMS Signer Dummy Certificate diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfo.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfo.cs index b964275..e304950 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfo.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfo.cs @@ -662,7 +662,7 @@ namespace System.Security.Cryptography.Pkcs { writer.PopSequence(); -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 Span setOfTag = stackalloc byte[1]; setOfTag[0] = 0x31; @@ -678,7 +678,7 @@ namespace System.Security.Cryptography.Pkcs { writer.PopSetOf(); -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 hasher.AppendData(writer.EncodeAsSpan()); #else hasher.AppendData(writer.Encode()); @@ -771,7 +771,7 @@ namespace System.Security.Cryptography.Pkcs return false; } -#if netcoreapp || netcoreapp30 || netstandard21 +#if NETCOREAPP || NETSTANDARD2_1 // SHA-2-512 is the biggest digest type we know about. Span digestValue = stackalloc byte[512 / 8]; ReadOnlySpan digest = digestValue; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/CertLoader.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/CertLoader.cs index 2bd11c4..4e7ee39 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/CertLoader.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/CertLoader.cs @@ -16,7 +16,7 @@ namespace Test.Cryptography // Prefer ephemeral when available private static X509KeyStorageFlags GetBestKeyStorageFlags() { -#if netcoreapp +#if NETCOREAPP if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { // On Windows 7 ephemeral keys with a key usage embedded in the PFX @@ -178,7 +178,7 @@ namespace Test.Cryptography internal override CertLoader CloneAsEphemeralLoader() { -#if netcoreapp +#if NETCOREAPP return new CertLoaderFromRawData(CerData, PfxData, Password) { KeyStorageFlags = X509KeyStorageFlags.EphemeralKeySet, diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTests.cs index 978bd0d..30b505f 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTests.cs @@ -836,7 +836,7 @@ namespace System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests if (cert == null) return; // Sorry - CertLoader is not configured to load certs with private keys - we've tested as much as we can. -#if netcoreapp // API not present on netfx +#if NETCOREAPP // API not present on netfx if (_useExplicitPrivateKey) { using (X509Certificate2 pubCert = certLoader.GetCertificate()) diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/StateTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/StateTests.cs index 2f66194..c578ab6 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/StateTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/StateTests.cs @@ -275,7 +275,7 @@ namespace System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests [Theory] [OuterLoop(/* Leaks key on disk if interrupted */)] [InlineData(false)] -#if netcoreapp // API not supported on netfx +#if NETCOREAPP // API not supported on netfx [InlineData(true)] #endif public static void PostDecrypt_Encode(bool useExplicitPrivateKey) @@ -301,7 +301,7 @@ namespace System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests if (useExplicitPrivateKey) { -#if netcoreapp +#if NETCOREAPP ecms.Decrypt(r[0], cer.GetRSAPrivateKey()); #else Assert.True(false, "Should not run on this platform"); @@ -363,7 +363,7 @@ namespace System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests [Theory] [OuterLoop(/* Leaks key on disk if interrupted */)] [InlineData(false)] -#if netcoreapp // API not supported on netfx +#if NETCOREAPP // API not supported on netfx [InlineData(true)] #endif public static void PostDecrypt_Decrypt(bool useExplicitPrivateKey) @@ -405,7 +405,7 @@ namespace System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests { if (useExplicitPrivateKey) { -#if netcoreapp +#if NETCOREAPP ecms.Decrypt(r[0], cert1.GetRSAPrivateKey()); #else Assert.True(false, "Should not run on this platform"); diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs index ed86ff0..d261a61 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs @@ -563,7 +563,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.NotSame(cms.Certificates[0], firstSigner.Certificate); Assert.Equal(cms.Certificates[0], firstSigner.Certificate); -#if netcoreapp +#if NETCOREAPP byte[] signature = firstSigner.GetSignature(); Assert.NotEmpty(signature); // DSA PKIX signature format is a DER SEQUENCE. @@ -582,7 +582,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.Equal(identifierType, cms.SignerInfos[0].SignerIdentifier.Type); Assert.Equal(firstSigner.Certificate, cms.SignerInfos[0].Certificate); -#if netcoreapp +#if NETCOREAPP byte[] sig2 = cms.SignerInfos[0].GetSignature(); Assert.Equal(signature, sig2); #endif @@ -634,7 +634,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.NotSame(cms.Certificates[0], firstSigner.Certificate); Assert.Equal(cms.Certificates[0], firstSigner.Certificate); -#if netcoreapp +#if NETCOREAPP byte[] signature = firstSigner.GetSignature(); Assert.NotEmpty(signature); // ECDSA PKIX signature format is a DER SEQUENCE. @@ -656,7 +656,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.Equal(identifierType, cms.SignerInfos[0].SignerIdentifier.Type); Assert.Equal(firstSigner.Certificate, cms.SignerInfos[0].Certificate); -#if netcoreapp +#if NETCOREAPP byte[] sig2 = cms.SignerInfos[0].GetSignature(); Assert.Equal(signature, sig2); #endif @@ -952,7 +952,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.Equal(2, cms.SignerInfos.Count); // One of them is a V3 signer, so the whole document is V3. -#if netfx +#if NETFRAMEWORK // Windows CMS computes the version on the first signer, and doesn't // seem to lift it on the second one. // It encoded the message as @@ -963,7 +963,7 @@ namespace System.Security.Cryptography.Pkcs.Tests { #endif Assert.Equal(3, cms.Version); -#if netfx +#if NETFRAMEWORK } #endif @@ -1058,7 +1058,7 @@ namespace System.Security.Cryptography.Pkcs.Tests cms.ComputeSignature(signer); bool ExpectCopyRemoved = -#if !netfx +#if !NETFRAMEWORK true #else false diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsWholeDocumentTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsWholeDocumentTests.cs index 1278e65..613c417 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsWholeDocumentTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsWholeDocumentTests.cs @@ -45,7 +45,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.Equal(SubjectIdentifierType.SubjectKeyIdentifier, signer.SignerIdentifier.Type); Assert.Equal("1063CAB14FB14C47DC211C0E0285F3EE5946BF2D", signer.SignerIdentifier.Value); Assert.Equal("2.16.840.1.101.3.4.2.1", signer.DigestAlgorithm.Value); -#if netcoreapp +#if NETCOREAPP Assert.Equal("1.2.840.113549.1.1.10", signer.SignatureAlgorithm.Value); #endif @@ -84,7 +84,7 @@ namespace System.Security.Cryptography.Pkcs.Tests "082A864886F70D0302020128", signedAttrs[3].Values[0].RawData.ByteArrayToHex()); -#if netcoreapp +#if NETCOREAPP Assert.Equal( "B93E81D141B3C9F159AB0021910635DC72E8E860BE43C28E5D53243D6DC247B7" + "D4F18C20195E80DEDCC75B29C43CE5047AD775B65BFC93589BD748B950C68BAD" + @@ -153,7 +153,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.Equal(SubjectIdentifierType.IssuerAndSerialNumber, signer.SignerIdentifier.Type); Assert.Equal(Oids.Sha1, signer.DigestAlgorithm.Value); -#if netcoreapp +#if NETCOREAPP Assert.Equal(Oids.Rsa, signer.SignatureAlgorithm.Value); Assert.Equal( @@ -220,7 +220,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.Equal(SubjectIdentifierType.IssuerAndSerialNumber, signer.SignerIdentifier.Type); Assert.Equal(Oids.Sha1, signer.DigestAlgorithm.Value); -#if netcoreapp +#if NETCOREAPP Assert.Equal(Oids.Rsa, signer.SignatureAlgorithm.Value); Assert.Equal( @@ -294,7 +294,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.Null(signer.Certificate); Assert.Equal(Oids.Sha1, signer.DigestAlgorithm.Value); -#if netcoreapp +#if NETCOREAPP Assert.Equal("1.3.6.1.5.5.7.6.2", signer.SignatureAlgorithm.Value); Assert.Equal( @@ -353,7 +353,7 @@ namespace System.Security.Cryptography.Pkcs.Tests "833378066BDCCBA7047EF6919843D181A57D6479", csMessageDigest.MessageDigest.ByteArrayToHex()); -#if netcoreapp +#if NETCOREAPP Assert.Equal(Oids.Rsa, counterSigner.SignatureAlgorithm.Value); Assert.Equal( @@ -430,7 +430,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.Empty(signer.CounterSignerInfos); Assert.Null(signer.Certificate); -#if netcoreapp +#if NETCOREAPP Assert.Equal(Oids.Rsa, signer.SignatureAlgorithm.Value); Assert.Equal( @@ -534,7 +534,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.Equal(SubjectIdentifierType.IssuerAndSerialNumber, signer.SignerIdentifier.Type); Assert.Equal(Oids.Sha1, signer.DigestAlgorithm.Value); -#if netcoreapp +#if NETCOREAPP Assert.Equal(Oids.Rsa, signer.SignatureAlgorithm.Value); Assert.Equal( @@ -580,7 +580,7 @@ namespace System.Security.Cryptography.Pkcs.Tests // Assert.NotThrows cms.CheckSignature(true); -#if netcoreapp +#if NETCOREAPP Assert.Equal( "1AA282DBED4D862D7CEA30F803E790BDB0C97EE852778CEEDDCD94BB9304A155" + "2E60A8D36052AC8C2D28755F3B2F473824100AB3A6ABD4C15ABD77E0FFE13D0D" + diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs index 422469c..33b9e7a 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs @@ -101,7 +101,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.NotSame(counterSigner.Certificate, counterSigner2.Certificate); Assert.Equal(counterSigner.Certificate, counterSigner2.Certificate); -#if netcoreapp +#if NETCOREAPP byte[] signature = counterSigner.GetSignature(); byte[] signature2 = counterSigner2.GetSignature(); @@ -111,7 +111,7 @@ namespace System.Security.Cryptography.Pkcs.Tests } } -#if netcoreapp +#if NETCOREAPP [Fact] public static void SignerInfo_GetSignature_UniquePerCall() { @@ -140,7 +140,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.NotSame(oid, oid2); } -#if netcoreapp +#if NETCOREAPP [Fact] public static void SignerInfo_SignatureAlgorithm_NotSame() { @@ -599,7 +599,7 @@ namespace System.Security.Cryptography.Pkcs.Tests // content-type attribute even for counter-signers. int expectedAttrCount = 1; // One of them is a V3 signer. -#if netfx +#if NETFRAMEWORK expectedAttrCount = 2; #endif Assert.Equal(expectedAttrCount, counterSigner.SignedAttributes.Count); @@ -646,7 +646,7 @@ namespace System.Security.Cryptography.Pkcs.Tests // On NetFx there will be two attributes, because Windows emits the // content-type attribute even for counter-signers. int expectedCount = 1; -#if netfx +#if NETFRAMEWORK expectedCount = 2; #endif Assert.Equal(expectedCount, counterSigner.SignedAttributes.Count); @@ -736,7 +736,7 @@ namespace System.Security.Cryptography.Pkcs.Tests // On NetFx there will be two attributes, because Windows emits the // content-type attribute even for counter-signers. int expectedCount = 1; -#if netfx +#if NETFRAMEWORK expectedCount = 2; #endif Assert.Equal(expectedCount, counterSigner.SignedAttributes.Count); @@ -745,7 +745,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.NotEqual(firstSigner2.Certificate, counterSigner.Certificate); Assert.Equal(2, cms.Certificates.Count); -#if netcoreapp +#if NETCOREAPP byte[] signature = counterSigner.GetSignature(); Assert.NotEmpty(signature); // DSA PKIX signature format is a DER SEQUENCE. @@ -804,7 +804,7 @@ namespace System.Security.Cryptography.Pkcs.Tests // On NetFx there will be two attributes, because Windows emits the // content-type attribute even for counter-signers. int expectedCount = 1; -#if netfx +#if NETFRAMEWORK expectedCount = 2; #endif Assert.Equal(expectedCount, counterSigner.SignedAttributes.Count); @@ -813,7 +813,7 @@ namespace System.Security.Cryptography.Pkcs.Tests Assert.NotEqual(firstSigner2.Certificate, counterSigner.Certificate); Assert.Equal(2, cms.Certificates.Count); -#if netcoreapp +#if NETCOREAPP byte[] signature = counterSigner.GetSignature(); Assert.NotEmpty(signature); // DSA PKIX signature format is a DER SEQUENCE. @@ -1048,7 +1048,7 @@ namespace System.Security.Cryptography.Pkcs.Tests cms.SignerInfos[0].ComputeCounterSignature(signer); bool ExpectCopyRemoved = -#if netfx +#if NETFRAMEWORK false #else true diff --git a/src/libraries/System.Security.Cryptography.Primitives/tests/AsymmetricAlgorithm/Trivial.cs b/src/libraries/System.Security.Cryptography.Primitives/tests/AsymmetricAlgorithm/Trivial.cs index fa7b015..2936091 100644 --- a/src/libraries/System.Security.Cryptography.Primitives/tests/AsymmetricAlgorithm/Trivial.cs +++ b/src/libraries/System.Security.Cryptography.Primitives/tests/AsymmetricAlgorithm/Trivial.cs @@ -52,7 +52,7 @@ namespace System.Security.Cryptography.Encryption.Tests.Asymmetric } } -#if netcoreapp +#if NETCOREAPP [Fact] public static void ClearCallsDispose() { diff --git a/src/libraries/System.Security.Cryptography.Primitives/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography.Primitives/tests/CryptoStream.cs index ccb961c..4a1df4c 100644 --- a/src/libraries/System.Security.Cryptography.Primitives/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography.Primitives/tests/CryptoStream.cs @@ -218,7 +218,7 @@ namespace System.Security.Cryptography.Encryption.Tests.Asymmetric Assert.False(output.CanRead); } -#if netcoreapp +#if NETCOREAPP using (MemoryStream output = new MemoryStream()) { using (CryptoStream encryptStream = new CryptoStream(output, encryptor, CryptoStreamMode.Write, leaveOpen: false)) diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertificateCreation/CertificateRequestUsageTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertificateCreation/CertificateRequestUsageTests.cs index 9b116db..61aa19e 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertificateCreation/CertificateRequestUsageTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertificateCreation/CertificateRequestUsageTests.cs @@ -528,7 +528,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests.CertificateCreatio Exception exception = Assert.Throws( () => request.Create(request.SubjectName, generator, now, now.AddDays(1), new byte[1])); -#if netcoreapp +#if NETCOREAPP if (CultureInfo.CurrentCulture.Name == "en-US") { Assert.Contains("ASN1", exception.Message, StringComparison.OrdinalIgnoreCase); diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/X509StoreTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/X509StoreTests.cs index 4cc89c3..870f920 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/X509StoreTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/X509StoreTests.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if netcoreapp || uap +#if NETCOREAPP || uap #define HAVE_STORE_ISOPEN #endif diff --git a/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.Forwards.cs b/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.Forwards.cs index a37c450..f99a075 100644 --- a/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.Forwards.cs +++ b/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.Forwards.cs @@ -13,7 +13,7 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Permissions.SecurityAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Permissions.SecurityPermissionAttribute))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Permissions.SecurityPermissionFlag))] -#if netcoreapp || uap || netcoreapp30 +#if NETCOREAPP || uap [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.IStackWalk))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.PermissionSet))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Permissions.PermissionState))] diff --git a/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs b/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs index ba990df..3a40676 100644 --- a/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs +++ b/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs @@ -567,7 +567,7 @@ namespace System.Security void FromXml(System.Security.SecurityElement e, System.Security.Policy.PolicyLevel level); System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level); } -#if !netcoreapp && !netcoreapp30 && !uap +#if !NETCOREAPP && !uap public partial interface IStackWalk { void Assert(); @@ -591,7 +591,7 @@ namespace System.Security public override int GetHashCode() { throw null; } public override System.Security.SecurityElement ToXml() { throw null; } } -#if !netcoreapp && !netcoreapp30 && !uap +#if !NETCOREAPP && !uap public partial class PermissionSet : System.Collections.ICollection, System.Collections.IEnumerable, System.Runtime.Serialization.IDeserializationCallback, System.Security.ISecurityEncodable, System.Security.IStackWalk { public PermissionSet(System.Security.Permissions.PermissionState state) { } @@ -1101,7 +1101,7 @@ namespace System.Security.Permissions public override System.Security.IPermission CreatePermission() { throw null; } public System.Security.PermissionSet CreatePermissionSet() { throw null; } } -#if !netcoreapp && !netcoreapp30 && !uap +#if !NETCOREAPP && !uap public enum PermissionState { None = 0, diff --git a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/SID.cs b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/SID.cs index ad95a28..83686ed 100644 --- a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/SID.cs +++ b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/SID.cs @@ -782,7 +782,7 @@ nameof(binaryForm)); // otherwise you would see this: "S-1-NTAuthority-32-544" // -#if netcoreapp20 +#if NETCOREAPP2_0 StringBuilder result = new StringBuilder(); result.Append("S-1-").Append((ulong)_identifierAuthority); for (int i = 0; i < SubAuthorityCount; i++) diff --git a/src/libraries/System.Security.Principal.Windows/tests/WellKnownSidTypeTests.cs b/src/libraries/System.Security.Principal.Windows/tests/WellKnownSidTypeTests.cs index cb103b7..616601e 100644 --- a/src/libraries/System.Security.Principal.Windows/tests/WellKnownSidTypeTests.cs +++ b/src/libraries/System.Security.Principal.Windows/tests/WellKnownSidTypeTests.cs @@ -86,7 +86,7 @@ public class WellKnownSidTypeTests } } -#if netcoreapp +#if NETCOREAPP [ConditionalTheory(nameof(AccountIsDomainJoined))] [InlineData(WellKnownSidType.WinBuiltinDCOMUsersSid)] [InlineData(WellKnownSidType.WinBuiltinIUsersSid)] diff --git a/src/libraries/System.Text.Json/src/System.Text.Json.csproj b/src/libraries/System.Text.Json/src/System.Text.Json.csproj index 8c9891a..056b1f6 100644 --- a/src/libraries/System.Text.Json/src/System.Text.Json.csproj +++ b/src/libraries/System.Text.Json/src/System.Text.Json.csproj @@ -7,7 +7,6 @@ $(DefineConstants);BUILDING_INBOX_LIBRARY - $(DefineConstants);netstandard diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.cs index e774adc..163383d 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.cs @@ -72,7 +72,7 @@ namespace System.Text.Json internal static string Utf8GetString(ReadOnlySpan bytes) { return Encoding.UTF8.GetString(bytes -#if netstandard +#if NETSTANDARD2_0 || NETFRAMEWORK .ToArray() #endif ); @@ -83,7 +83,7 @@ namespace System.Text.Json /// internal static bool TryAdd(Dictionary dictionary, TKey key, TValue value) { -#if netstandard +#if NETSTANDARD2_0 || NETFRAMEWORK if (!dictionary.ContainsKey(key)) { dictionary[key] = value; diff --git a/src/libraries/System.Text.Json/tests/JsonPropertyTests.cs b/src/libraries/System.Text.Json/tests/JsonPropertyTests.cs index 2625578..bb17b4b 100644 --- a/src/libraries/System.Text.Json/tests/JsonPropertyTests.cs +++ b/src/libraries/System.Text.Json/tests/JsonPropertyTests.cs @@ -86,7 +86,7 @@ namespace System.Text.Json.Tests expectedValue, Encoding.UTF8.GetString( buffer.WrittenSpan -#if netfx +#if NETFRAMEWORK .ToArray() #endif )); diff --git a/src/libraries/System.Text.Json/tests/JsonTestHelper.cs b/src/libraries/System.Text.Json/tests/JsonTestHelper.cs index 87dd679..5af9d78 100644 --- a/src/libraries/System.Text.Json/tests/JsonTestHelper.cs +++ b/src/libraries/System.Text.Json/tests/JsonTestHelper.cs @@ -713,7 +713,7 @@ namespace System.Text.Json { string value = Encoding.UTF8.GetString( buffer.WrittenSpan -#if netfx +#if NETFRAMEWORK .ToArray() #endif ); @@ -735,7 +735,7 @@ namespace System.Text.Json { string value = Encoding.UTF8.GetString( buffer.WrittenSpan -#if netfx +#if NETFRAMEWORK .ToArray() #endif ); diff --git a/src/libraries/System.Text.Json/tests/Utf8JsonWriterTests.cs b/src/libraries/System.Text.Json/tests/Utf8JsonWriterTests.cs index d10a590..f8b625f 100644 --- a/src/libraries/System.Text.Json/tests/Utf8JsonWriterTests.cs +++ b/src/libraries/System.Text.Json/tests/Utf8JsonWriterTests.cs @@ -4332,7 +4332,7 @@ namespace System.Text.Json.Tests string result = Encoding.UTF8.GetString( output.WrittenSpan -#if netfx +#if NETFRAMEWORK .ToArray() #endif ); diff --git a/src/libraries/System.ValueTuple/tests/ValueTupleTests.cs b/src/libraries/System.ValueTuple/tests/ValueTupleTests.cs index 2b48886..38a87c1 100644 --- a/src/libraries/System.ValueTuple/tests/ValueTupleTests.cs +++ b/src/libraries/System.ValueTuple/tests/ValueTupleTests.cs @@ -4,7 +4,7 @@ using System.Collections; using Xunit; -#if netcoreapp +#if NETCOREAPP using System.Runtime.CompilerServices; #endif @@ -773,7 +773,7 @@ namespace System.Tests AssertExtensions.Throws("other", () => ((IStructuralComparable)a).CompareTo("string", DummyTestComparer.Instance)); Assert.Equal("(1, 2, 3, 4, 5, 6, 7, )", CreateLong(1, 2, 3, 4, 5, 6, 7, new ValueTuple()).ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = ValueTuple.Create(); Assert.Throws(() => it[-1].ToString()); Assert.Throws(() => it[0].ToString()); @@ -804,7 +804,7 @@ namespace System.Tests Assert.Equal("()", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = ValueTuple.Create(1); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -836,7 +836,7 @@ namespace System.Tests Assert.Equal("(, )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = ValueTuple.Create(1, 2); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -871,7 +871,7 @@ namespace System.Tests Assert.Equal("(, , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = ValueTuple.Create(1, 2, 3); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -910,7 +910,7 @@ namespace System.Tests Assert.Equal("(, , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = ValueTuple.Create(1, 2, 3, 4); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -952,7 +952,7 @@ namespace System.Tests Assert.Equal("(, , , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = ValueTuple.Create(1, 2, 3, 4, 5); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -997,7 +997,7 @@ namespace System.Tests Assert.Equal("(, , , , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = ValueTuple.Create(1, 2, 3, 4, 5, 6); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -1045,7 +1045,7 @@ namespace System.Tests Assert.Equal("(, , , , , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = ValueTuple.Create(1, 2, 3, 4, 5, 6, 7); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -1117,7 +1117,7 @@ namespace System.Tests Assert.Equal("(, , , , , , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = CreateLong(1, 2, 3, 4, 5, 6, 7, ValueTuple.Create(8)); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -1206,7 +1206,7 @@ namespace System.Tests Assert.Equal("(1, 2, 3, 4, 5, 6, 7, 1, 0, 0, 0, 0, 0, 0, 42)", CreateLong(1, 2, 3, 4, 5, 6, 7, d).ToString()); -#if netcoreapp +#if NETCOREAPP ITuple it = d; Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); diff --git a/src/libraries/mscorlib.WinRT-Facade/ref/TypeForwards.cs b/src/libraries/mscorlib.WinRT-Facade/ref/TypeForwards.cs index 40be9d9..a0c3b29 100644 --- a/src/libraries/mscorlib.WinRT-Facade/ref/TypeForwards.cs +++ b/src/libraries/mscorlib.WinRT-Facade/ref/TypeForwards.cs @@ -19,7 +19,7 @@ using System.Runtime.CompilerServices; [assembly: TypeForwardedTo(typeof(System.IntPtr))] [assembly: TypeForwardedTo(typeof(System.MulticastDelegate))] [assembly: TypeForwardedTo(typeof(System.Object))] -#if !NETSTANDARD10 && !NETSTANDARD12 +#if !NETSTANDARD1_0 && !NETSTANDARD1_2 [assembly: TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsConst))] #endif [assembly: TypeForwardedTo(typeof(System.Single))] diff --git a/src/libraries/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj b/src/libraries/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj index f49888a..ad6a108 100644 --- a/src/libraries/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj +++ b/src/libraries/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj @@ -7,7 +7,6 @@ against Windows.winmd. The real mscorlib comes from src/shims/shims.proj --> false netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;netstandard1.0-Debug;netstandard1.0-Release;uap-Debug;uap-Release - $(DefineConstants);NETSTANDARD12 diff --git a/src/libraries/shims/manual/System.Data.forwards.cs b/src/libraries/shims/manual/System.Data.forwards.cs index 81aaf80..c3e349f 100644 --- a/src/libraries/shims/manual/System.Data.forwards.cs +++ b/src/libraries/shims/manual/System.Data.forwards.cs @@ -5,7 +5,7 @@ // Add any internal types that we need to forward from System.Data. // These types are required for Desktop to Core serialization as they are not covered by GenAPI because they are not exposed in the ref assembly. -#if netcoreapp +#if NETCOREAPP // System.Data.Odbc is only supported on netcoreapp [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Odbc.ODBC32))] #endif \ No newline at end of file