diff --git a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/ILInputCompiler.cs b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/ILInputCompiler.cs index e95197b669c94f..80a48c2da1695e 100644 --- a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/ILInputCompiler.cs +++ b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/ILInputCompiler.cs @@ -45,7 +45,7 @@ protected virtual void SetupProcess (Process process, CompilerOptions options) private static string BuildArguments (CompilerOptions options) { var args = new StringBuilder (); -#if NETCOREAPP +#if NET args.Append (options.OutputPath.ExtensionWithDot == ".dll" ? "-dll" : "-exe"); args.Append ($" -out:{options.OutputPath.InQuotes ()}"); #else @@ -58,7 +58,7 @@ private static string BuildArguments (CompilerOptions options) protected virtual NPath LocateIlasm () { -#if NETCOREAPP +#if NET var extension = RuntimeInformation.IsOSPlatform (OSPlatform.Windows) ? ".exe" : ""; var toolsDir = (string) AppContext.GetData ("Mono.Linker.Tests.ILToolsDir")!; diff --git a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs index 4ff90c22300d4c..825663ac8bdae1 100644 --- a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs +++ b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs @@ -77,7 +77,7 @@ public virtual IEnumerable GetDefines () yield return "WIN32"; if (Characteristics.HasFlag (TestRunCharacteristics.TargetingNetCore)) - yield return "NETCOREAPP"; + yield return "NET"; if (Characteristics.HasFlag (TestRunCharacteristics.SupportsDefaultInterfaceMethods)) yield return "SUPPORTS_DEFAULT_INTERFACE_METHODS"; diff --git a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompiler.cs b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompiler.cs index d2b637de124e6f..b20c16631302c2 100644 --- a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompiler.cs +++ b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompiler.cs @@ -9,7 +9,7 @@ using System.Text; using Mono.Linker.Tests.Extensions; using Xunit; -#if NETCOREAPP +#if NET using System.Runtime.InteropServices; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Emit; @@ -190,7 +190,7 @@ protected static NPath MakeSupportingAssemblyReferencePathAbsolute (NPath output if (Path.IsPathRooted (referenceFileName)) return referenceFileName.ToNPath (); -#if NETCOREAPP +#if NET if (referenceFileName.StartsWith ("System.", StringComparison.Ordinal) || referenceFileName.StartsWith ("Mono.", StringComparison.Ordinal) || referenceFileName.StartsWith ("Microsoft.", StringComparison.Ordinal) || @@ -224,14 +224,14 @@ protected NPath CompileAssembly (CompilerOptions options) protected virtual NPath CompileCSharpAssemblyWithDefaultCompiler (CompilerOptions options) { -#if NETCOREAPP +#if NET return CompileCSharpAssemblyWithRoslyn (options); #else return CompileCSharpAssemblyWithCsc (options); #endif } -#if NETCOREAPP +#if NET protected virtual NPath CompileCSharpAssemblyWithRoslyn (CompilerOptions options) { var languageVersion = LanguageVersion.Default; @@ -331,7 +331,7 @@ protected virtual NPath CompileCSharpAssemblyWithRoslyn (CompilerOptions options protected virtual NPath CompileCSharpAssemblyWithCsc (CompilerOptions options) { -#if NETCOREAPP +#if NET return CompileCSharpAssemblyWithRoslyn (options); #else return CompileCSharpAssemblyWithExternalCompiler (LocateCscExecutable (), options, "/shared "); diff --git a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs index 1d075aeffeb354..ebcad66b5e0c48 100644 --- a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs +++ b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs @@ -217,7 +217,7 @@ public virtual void ProcessOptions (TestCaseLinkerOptions options) IgnoreLinkAttributes (options.IgnoreLinkAttributes); -#if !NETCOREAPP +#if !NET if (!string.IsNullOrEmpty (options.Il8n)) AddIl8n (options.Il8n); #endif diff --git a/src/libraries/Common/src/Extensions/ChangeCallbackRegistrar.cs b/src/libraries/Common/src/Extensions/ChangeCallbackRegistrar.cs index eecd1fa8c1e515..aa7899a64136e3 100644 --- a/src/libraries/Common/src/Extensions/ChangeCallbackRegistrar.cs +++ b/src/libraries/Common/src/Extensions/ChangeCallbackRegistrar.cs @@ -21,7 +21,7 @@ internal static class ChangeCallbackRegistrar /// The registration. internal static IDisposable UnsafeRegisterChangeCallback(Action callback, object? state, CancellationToken token, Action onFailure, T onFailureState) { -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 try { return token.UnsafeRegister(callback, state); diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs index 41c079d5ad144e..ec001c0b55a93d 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs @@ -56,7 +56,7 @@ internal static unsafe ErrorCode NCryptGetIntProperty(SafeNCryptHandle hObject, { fixed (int* pResult = &result) { -#if NETSTANDARD || NETCOREAPP +#if NETSTANDARD || NET Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); #endif diff --git a/src/libraries/Common/src/System/HashCodeRandomization.cs b/src/libraries/Common/src/System/HashCodeRandomization.cs index 16cd6cb577c052..8a7273e51eaeb1 100644 --- a/src/libraries/Common/src/System/HashCodeRandomization.cs +++ b/src/libraries/Common/src/System/HashCodeRandomization.cs @@ -16,7 +16,7 @@ internal static class HashCodeRandomization { public static int GetRandomizedOrdinalHashCode(this string value) { -#if NETCOREAPP +#if NET // In .NET Core, string hash codes are already randomized. return value.GetHashCode(); diff --git a/src/libraries/Common/src/System/Reflection/AssemblyNameFormatter.cs b/src/libraries/Common/src/System/Reflection/AssemblyNameFormatter.cs index 9d5eeebc85a6d0..b4fbdca1e9091e 100644 --- a/src/libraries/Common/src/System/Reflection/AssemblyNameFormatter.cs +++ b/src/libraries/Common/src/System/Reflection/AssemblyNameFormatter.cs @@ -129,7 +129,7 @@ private static void AppendQuoted(this ref ValueStringBuilder vsb, string s) vsb.Append(quoteChar); } -#if !NETCOREAPP +#if !NET private static void AppendSpanFormattable(this ref ValueStringBuilder vsb, ushort value) { vsb.Append(value.ToString()); diff --git a/src/libraries/Common/src/System/Resources/ResourceWriter.cs b/src/libraries/Common/src/System/Resources/ResourceWriter.cs index 1f93de2776395b..81a70e7ae2f521 100644 --- a/src/libraries/Common/src/System/Resources/ResourceWriter.cs +++ b/src/libraries/Common/src/System/Resources/ResourceWriter.cs @@ -488,7 +488,7 @@ private static ResourceTypeCode FindTypeCode(object? value, List types) if (typeName.StartsWith("ResourceTypeCode.", StringComparison.Ordinal)) { typeName = typeName.Substring(17); // Remove through '.' -#if NETCOREAPP +#if NET ResourceTypeCode typeCode = Enum.Parse(typeName); #else ResourceTypeCode typeCode = (ResourceTypeCode)Enum.Parse(typeof(ResourceTypeCode), typeName); diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs index f299c936232547..38e60abcebc640 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs @@ -63,7 +63,7 @@ internal bool VerifyMac( throw new CryptographicException(SR.Cryptography_Der_Invalid_Encoding); } -#if NETCOREAPP +#if NET Debug.Assert(expectedOutputSize <= 64); // SHA512 is the largest digest size we know about Span derived = stackalloc byte[expectedOutputSize]; #else diff --git a/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs b/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs index dd3a37c32237bf..e4b71ded239f2d 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs @@ -27,7 +27,7 @@ internal static void Return(byte[] array, int clearSize = ClearAll) if (!clearWholeArray && clearSize != 0) { -#if (NETCOREAPP || NETSTANDARD2_1) && !CP_NO_ZEROMEMORY +#if (NET || NETSTANDARD2_1) && !CP_NO_ZEROMEMORY CryptographicOperations.ZeroMemory(array.AsSpan(0, clearSize)); #else Array.Clear(array, 0, clearSize); diff --git a/src/libraries/Common/src/System/Security/Cryptography/Helpers.cs b/src/libraries/Common/src/System/Security/Cryptography/Helpers.cs index 0071c345d1d20a..462e4d26a8f64d 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Helpers.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Helpers.cs @@ -12,13 +12,13 @@ internal static partial class Helpers { [UnsupportedOSPlatformGuard("browser")] internal static bool HasSymmetricEncryption { get; } = -#if NETCOREAPP +#if NET !OperatingSystem.IsBrowser(); #else true; #endif -#if NETCOREAPP +#if NET [UnsupportedOSPlatformGuard("ios")] [UnsupportedOSPlatformGuard("tvos")] public static bool IsDSASupported => !OperatingSystem.IsIOS() && !OperatingSystem.IsTvOS(); @@ -26,7 +26,7 @@ internal static partial class Helpers public static bool IsDSASupported => true; #endif -#if NETCOREAPP +#if NET [UnsupportedOSPlatformGuard("android")] [UnsupportedOSPlatformGuard("browser")] public static bool IsRC2Supported => !OperatingSystem.IsAndroid() && !OperatingSystem.IsBrowser(); @@ -36,7 +36,7 @@ internal static partial class Helpers [UnsupportedOSPlatformGuard("browser")] internal static bool HasMD5 { get; } = -#if NETCOREAPP +#if NET !OperatingSystem.IsBrowser(); #else true; diff --git a/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs b/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs index 75424aed0d3cc3..51e1cccb43e305 100644 --- a/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs +++ b/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs @@ -27,7 +27,7 @@ internal sealed class PooledByteBufferWriter : IBufferWriter, IDisposable private PooledByteBufferWriter() { -#if NETCOREAPP +#if NET // Ensure we are in sync with the Array.MaxLength implementation. Debug.Assert(MaximumBufferSize == Array.MaxLength); #endif @@ -147,7 +147,7 @@ public Span GetSpan(int sizeHint = MinimumBufferSize) return _rentedBuffer.AsSpan(_index); } -#if NETCOREAPP +#if NET internal ValueTask WriteToStreamAsync(Stream destination, CancellationToken cancellationToken) { return destination.WriteAsync(WrittenMemory, cancellationToken); diff --git a/src/libraries/Common/src/System/Text/ValueStringBuilder.cs b/src/libraries/Common/src/System/Text/ValueStringBuilder.cs index a0844b04664248..14aa77db3e57b0 100644 --- a/src/libraries/Common/src/System/Text/ValueStringBuilder.cs +++ b/src/libraries/Common/src/System/Text/ValueStringBuilder.cs @@ -161,7 +161,7 @@ public void Insert(int index, string? s) int remaining = _pos - index; _chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); s -#if !NETCOREAPP +#if !NET .AsSpan() #endif .CopyTo(_chars.Slice(index)); @@ -213,7 +213,7 @@ private void AppendSlow(string s) } s -#if !NETCOREAPP +#if !NET .AsSpan() #endif .CopyTo(_chars.Slice(pos)); diff --git a/src/libraries/Common/tests/SourceGenerators/RoslynTestUtils.cs b/src/libraries/Common/tests/SourceGenerators/RoslynTestUtils.cs index e67289721d8af9..e1c53d3b8aa16e 100644 --- a/src/libraries/Common/tests/SourceGenerators/RoslynTestUtils.cs +++ b/src/libraries/Common/tests/SourceGenerators/RoslynTestUtils.cs @@ -349,7 +349,7 @@ private static async Task RecreateDocumentAsync(Document document) } private static string ReplaceLineEndings(string text) => -#if NETCOREAPP +#if NET text.ReplaceLineEndings("\n"); #else text.Replace("\r\n", "\n"); diff --git a/src/libraries/Common/tests/System/Collections/TestBase.Generic.cs b/src/libraries/Common/tests/System/Collections/TestBase.Generic.cs index 73d382893d2898..0a22540b6588b9 100644 --- a/src/libraries/Common/tests/System/Collections/TestBase.Generic.cs +++ b/src/libraries/Common/tests/System/Collections/TestBase.Generic.cs @@ -255,7 +255,7 @@ protected IEnumerable CreateHashSet(IEnumerable enumerableToMatchTo, int c return set; } -#if NETCOREAPP +#if NET /// /// Create a HashSet with a specific initial capacity and fill it with a specific number of elements. /// diff --git a/src/libraries/Common/tests/System/IO/Compression/ZipTestHelper.cs b/src/libraries/Common/tests/System/IO/Compression/ZipTestHelper.cs index 6d194788762fa4..9666a16e2fb3ce 100644 --- a/src/libraries/Common/tests/System/IO/Compression/ZipTestHelper.cs +++ b/src/libraries/Common/tests/System/IO/Compression/ZipTestHelper.cs @@ -233,7 +233,7 @@ public static void IsZipSameAsDir(Stream archiveFile, string directory, ZipArchi using (Stream entrystream = entry.Open()) { ReadAllBytes(entrystream, buffer, 0, buffer.Length); -#if NETCOREAPP +#if NET uint zipcrc = entry.Crc32; Assert.Equal(CRC.CalculateCRC(buffer), zipcrc); #endif diff --git a/src/libraries/Common/tests/System/Net/Http/ByteAtATimeContent.cs b/src/libraries/Common/tests/System/Net/Http/ByteAtATimeContent.cs index d1b54ece613db1..e0407d918acc4d 100644 --- a/src/libraries/Common/tests/System/Net/Http/ByteAtATimeContent.cs +++ b/src/libraries/Common/tests/System/Net/Http/ByteAtATimeContent.cs @@ -24,7 +24,7 @@ public ByteAtATimeContent(int length, Task waitToSend, TaskCompletionSource SerializeToStreamAsync(stream, context).GetAwaiter().GetResult(); #endif diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs index 4da9edc2ca2147..f45206e9941dfe 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs @@ -200,7 +200,7 @@ await server.AcceptConnectionAsync(async connection => } [Theory] -#if NETCOREAPP +#if NET [InlineData(DecompressionMethods.Brotli, "br", "")] [InlineData(DecompressionMethods.Brotli, "br", "br")] [InlineData(DecompressionMethods.Brotli, "br", "gzip")] @@ -264,7 +264,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) => } [Theory] -#if NETCOREAPP +#if NET [InlineData(DecompressionMethods.GZip | DecompressionMethods.Deflate | DecompressionMethods.Brotli, "gzip; q=1.0, deflate; q=1.0, br; q=1.0", "")] #endif [InlineData(DecompressionMethods.GZip | DecompressionMethods.Deflate, "gzip; q=1.0, deflate; q=1.0", "")] diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs index fdf301a809b863..689a6d6821eb62 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; -#if !NETCOREAPP +#if !NET using System.Diagnostics; #endif using System.IO; @@ -90,7 +90,7 @@ public VersionCheckerHttpHandler(HttpMessageHandler innerHandler, Version expect _expectedVersion = expectedVersion; } -#if NETCOREAPP +#if NET protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) { if (request.Version != _expectedVersion) @@ -138,7 +138,7 @@ public static Task SendAsync(this HttpClient client, bool a } else { -#if NETCOREAPP +#if NET // Note that the sync call must be done on a different thread because it blocks until the server replies. // However, the server-side of the request handling is in many cases invoked after the client, thus deadlocking the test. return Task.Run(() => client.Send(request, completionOption, cancellationToken)); @@ -159,7 +159,7 @@ public static Task SendAsync(this HttpMessageInvoker invoke } else { -#if NETCOREAPP +#if NET // Note that the sync call must be done on a different thread because it blocks until the server replies. // However, the server-side of the request handling is in many cases invoked after the client, thus deadlocking the test. return Task.Run(() => invoker.Send(request, cancellationToken)); @@ -176,7 +176,7 @@ public static Task ReadAsStreamAsync(this HttpContent content, bool asyn { if (async) { -#if NETCOREAPP +#if NET // No CancellationToken accepting overload on NETFX. return content.ReadAsStreamAsync(cancellationToken); #else @@ -186,7 +186,7 @@ public static Task ReadAsStreamAsync(this HttpContent content, bool asyn } else { -#if NETCOREAPP +#if NET return Task.FromResult(content.ReadAsStream(cancellationToken)); #else // Framework won't ever have the sync API. @@ -199,7 +199,7 @@ public static Task ReadAsStreamAsync(this HttpContent content, bool asyn public static Task GetByteArrayAsync(this HttpClient client, bool async, bool useCopyTo, Uri uri) { -#if NETCOREAPP +#if NET return Task.Run(async () => { var m = new HttpRequestMessage(HttpMethod.Get, uri); diff --git a/src/libraries/Common/tests/System/Net/Http/HttpMessageHandlerLoopbackServer.cs b/src/libraries/Common/tests/System/Net/Http/HttpMessageHandlerLoopbackServer.cs index 9d9d412511ac6e..4b6a326cf6f585 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpMessageHandlerLoopbackServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpMessageHandlerLoopbackServer.cs @@ -60,7 +60,7 @@ public LoopbackServerHttpMessageHandler(Func AllowAllCertificates = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; #else public static Func AllowAllCertificates = (_, __, ___, ____) => true; @@ -149,7 +149,7 @@ public static X509Certificate2 CreateServerSelfSignedCertificate(string name = " } } -#if NETCOREAPP +#if NET public static SocketsHttpHandler CreateSocketsHttpHandler(bool allowAllCertificates = false) { var handler = new SocketsHttpHandler(); 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 cd8bf922227cd6..6ad596a040c4b3 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 @@ -75,7 +75,7 @@ public void InvalidArrayArguments_Throws() } } -#if NETCOREAPP +#if NET [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on Browser/iOS/tvOS/MacCatalyst")] public sealed class DSASignVerify_Span : DSASignVerify { 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 a49b2c3329b725..b0c5823145a87b 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 @@ -5,7 +5,7 @@ namespace System.Security.Cryptography.Tests { public class CurveDef { -#if NETCOREAPP +#if NET 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 5f9dae4c8fcefb..8cc2391ba8dce8 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 @@ -15,7 +15,7 @@ namespace System.Security.Cryptography.Tests /// public abstract class EccTestBase { -#if NETCOREAPP +#if NET 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 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 84bbea4587eef4..9a2de091ab3b42 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 @@ -7,7 +7,7 @@ public interface IECDiffieHellmanProvider { ECDiffieHellman Create(); ECDiffieHellman Create(int keySize); -#if NETCOREAPP +#if NET ECDiffieHellman Create(ECCurve curve); #endif bool IsCurveValid(Oid oid); @@ -29,7 +29,7 @@ public static ECDiffieHellman Create(int keySize) return s_provider.Create(keySize); } -#if NETCOREAPP +#if NET 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 0065092e52aad1..ae8d32b02cc665 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 @@ -290,7 +290,7 @@ public static IEnumerable HashDerivationTestCases() } } -#if NETCOREAPP +#if NET [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 f95fb64aafd3a4..575a9d853fe266 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 @@ -349,7 +349,7 @@ public static IEnumerable HmacDerivationTestCases() } } -#if NETCOREAPP +#if NET [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 82f78094bb1000..1c507beee0d8d7 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 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests { -#if NETCOREAPP +#if NET 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 d79d8de3edba17..ce07c475bec5fd 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 @@ -8,7 +8,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests { -#if NETCOREAPP +#if NET // 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 4bffb87b2dd1da..d8c6e8f0ff0641 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 @@ -189,7 +189,7 @@ public static IEnumerable TlsDerivationTestCases() }; } -#if NETCOREAPP +#if NET [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 0b41aa08ea28c7..dc7a757d6e5373 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 @@ -172,7 +172,7 @@ public static void UseAfterDispose(bool importKey) pubKey.Dispose(); } -#if NETCOREAPP +#if NET 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 59d45d3de99c7e..01e5dfe6701f48 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 @@ -7,7 +7,7 @@ public interface IECDsaProvider { ECDsa Create(); ECDsa Create(int keySize); -#if NETCOREAPP +#if NET ECDsa Create(ECCurve curve); #endif bool IsCurveValid(Oid oid); @@ -26,7 +26,7 @@ public static ECDsa Create(int keySize) return s_provider.Create(keySize); } -#if NETCOREAPP +#if NET 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 1925320e66ab5a..058b626c62c89a 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 @@ -15,7 +15,7 @@ public class ECDsaImportExportTests : ECDsaTestsBase internal static bool CanDeriveNewPublicKey { get; } = EcDiffieHellman.Tests.ECDiffieHellmanFactory.CanDeriveNewPublicKey; -#if NETCOREAPP +#if NET [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 b40f4e721a497d..43c44b71a2a288 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 @@ -30,7 +30,7 @@ protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) throw new NotImplementedException(); } -#if NETCOREAPP +#if NET 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 d0c596935ef092..e0da3f3e75a811 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 @@ -13,7 +13,7 @@ public abstract partial class ECDsaTests : ECDsaTestsBase // FIPS 186-4 ECDSA test vectors // 186-3ecdsatestvectors.zip // SigGen.txt -#if NETCOREAPP +#if NET [Fact] public void ValidateNistP256Sha256() { 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 9da985adfd21fb..9c2e3fc0b44abd 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 [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public abstract class ECDsaTestsBase : EccTestBase { -#if NETCOREAPP +#if NET internal static void Verify256(ECDsa e, bool expected) { byte[] sig = ("998791331eb2e1f4259297f5d9cb82fa20dec98e1cb0900e6b8f014a406c3d02cbdbf5238bde471c3155fc25565524301429" diff --git a/src/libraries/Common/tests/System/Security/Cryptography/PlatformSupport.cs b/src/libraries/Common/tests/System/Security/Cryptography/PlatformSupport.cs index ae9f09caf23a5d..7be1321023e2bf 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/PlatformSupport.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/PlatformSupport.cs @@ -74,7 +74,7 @@ static bool DetermineAlgorithmFunctional(CngAlgorithm algorithm) // Whether or not the current platform supports RC2 internal static readonly bool IsRC2Supported = !PlatformDetection.IsAndroid; -#if NETCOREAPP +#if NET internal static readonly bool IsAndroidVersionAtLeast31 = OperatingSystem.IsAndroidVersionAtLeast(31); #else internal static readonly bool IsAndroidVersionAtLeast31 = false; diff --git a/src/libraries/Common/tests/TestUtilities/System/AssertExtensions.cs b/src/libraries/Common/tests/TestUtilities/System/AssertExtensions.cs index 0d658dae016cc7..cdab35da2b134b 100644 --- a/src/libraries/Common/tests/TestUtilities/System/AssertExtensions.cs +++ b/src/libraries/Common/tests/TestUtilities/System/AssertExtensions.cs @@ -27,7 +27,7 @@ public static class AssertExtensions public static void ThrowsOnAot(Action action) where T : Exception { -#if NETCOREAPP // Dynamic code is always supported on .NET Framework +#if NET // Dynamic code is always supported on .NET Framework if (!RuntimeFeature.IsDynamicCodeSupported) { Assert.Throws(action); diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index ec6645cec0c319..8aac8589611098 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -125,7 +125,7 @@ public static int SlowRuntimeTimeoutModifier public static bool IsCaseInsensitiveOS => IsWindows || IsOSX || IsMacCatalyst; public static bool IsCaseSensitiveOS => !IsCaseInsensitiveOS; -#if NETCOREAPP +#if NET public static bool FileCreateCaseSensitive => IsCaseSensitiveOS && !RuntimeInformation.RuntimeIdentifier.StartsWith("iossimulator") && !RuntimeInformation.RuntimeIdentifier.StartsWith("tvossimulator"); #else @@ -181,7 +181,7 @@ private static bool GetLinqExpressionsBuiltWithIsInterpretingOnly() public static bool IsNotInContainer => !IsInContainer; public static bool SupportsComInterop => IsWindows && IsNotMonoRuntime && !IsNativeAot; // matches definitions in clr.featuredefines.props -#if NETCOREAPP +#if NET public static bool IsBuiltInComEnabled => SupportsComInterop && (AppContext.TryGetSwitch("System.Runtime.InteropServices.BuiltInComInterop.IsSupported", out bool isEnabled) ? isEnabled @@ -198,7 +198,7 @@ private static bool GetLinqExpressionsBuiltWithIsInterpretingOnly() public static bool SupportsSsl3 => GetSsl3Support(); public static bool SupportsSsl2 => IsWindows && !PlatformDetection.IsWindows10Version1607OrGreater; -#if NETCOREAPP +#if NET public static bool IsReflectionEmitSupported => RuntimeFeature.IsDynamicCodeSupported; public static bool IsNotReflectionEmitSupported => !IsReflectionEmitSupported; #else @@ -668,7 +668,7 @@ private static bool GetSendsCAListByDefault() private static bool GetIsRunningOnMonoInterpreter() { -#if NETCOREAPP +#if NET return IsMonoRuntime && RuntimeFeature.IsDynamicCodeSupported && !RuntimeFeature.IsDynamicCodeCompiled; #else return false; diff --git a/src/libraries/Common/tests/TestUtilities/System/Runtime/InteropServices/SafeBufferUtil.cs b/src/libraries/Common/tests/TestUtilities/System/Runtime/InteropServices/SafeBufferUtil.cs index f667b1e26cec55..d3ff55aa515635 100644 --- a/src/libraries/Common/tests/TestUtilities/System/Runtime/InteropServices/SafeBufferUtil.cs +++ b/src/libraries/Common/tests/TestUtilities/System/Runtime/InteropServices/SafeBufferUtil.cs @@ -19,7 +19,7 @@ private sealed class AllocHGlobalSafeHandle : SafeBuffer { public AllocHGlobalSafeHandle(nuint cb) : base(ownsHandle: true) { -#if !NETCOREAPP +#if !NET RuntimeHelpers.PrepareConstrainedRegions(); #endif try diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs index 658653c28c0fe1..060d1f55d72a05 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs @@ -952,7 +952,7 @@ private static bool TypeIsASetInterface(Type type) Type genericTypeDefinition = type.GetGenericTypeDefinition(); return genericTypeDefinition == typeof(ISet<>) -#if NETCOREAPP +#if NET || genericTypeDefinition == typeof(IReadOnlySet<>) #endif ; diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.Collections.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.Collections.cs index 73afe160f28f2c..06b44553ab9fd5 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.Collections.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.Collections.cs @@ -1532,7 +1532,7 @@ public void CanBindISetNoSetter() Assert.Equal("Yo2", options.ISetNoSetter.ElementAt(1)); } -#if NETCOREAPP +#if NET [Fact] public void CanBindInstantiatedIReadOnlySet() { @@ -2291,7 +2291,7 @@ public void TestOptionsWithDifferentCollectionInterfaces() Assert.True(3 == options.UnInstantiatedISet.Count(), $"UnInstantiatedISet count is {options.UnInstantiatedISet.Count()} .. {options.UnInstantiatedISet.ElementAt(options.UnInstantiatedISet.Count() - 1)}"); Assert.Equal(new string[] { "a", "A", "B" }, options.UnInstantiatedISet); -#if NETCOREAPP +#if NET Assert.True(3 == options.InstantiatedIReadOnlySet.Count(), $"InstantiatedIReadOnlySet count is {options.InstantiatedIReadOnlySet.Count()} .. {options.InstantiatedIReadOnlySet.ElementAt(options.InstantiatedIReadOnlySet.Count() - 1)}"); Assert.Equal(new string[] { "a", "b", "Z" }, options.InstantiatedIReadOnlySet); Assert.False(options.IsSameInstantiatedIReadOnlySet()); diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.Helpers.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.Helpers.cs index d6521ed86dfdec..488e9b81c99d1f 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.Helpers.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.Helpers.cs @@ -109,7 +109,7 @@ public string ReadOnly public ISet UninstantiatedHashSetWithUnsupportedKey { get; set; } -#if NETCOREAPP +#if NET public IReadOnlySet InstantiatedIReadOnlySet { get; set; } = new HashSet(); public IReadOnlySet InstantiatedIReadOnlySetWithSomeValues { get; set; } = new HashSet(new[] { "existing1", "existing2" }); diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.TestClasses.Collections.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.TestClasses.Collections.cs index c8f672eb7fdb75..30d1fc8dc5b8c0 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.TestClasses.Collections.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.TestClasses.Collections.cs @@ -354,7 +354,7 @@ public class OptionsWithDifferentCollectionInterfaces public ISet InstantiatedISet { get; set; } = s_instantiatedISet; public bool IsSameInstantiatedISet() => object.ReferenceEquals(s_instantiatedISet, InstantiatedISet); -#if NETCOREAPP +#if NET private static IReadOnlySet s_instantiatedIReadOnlySet = new HashSet(StringComparer.OrdinalIgnoreCase) { "a", "A", "b" }; public IReadOnlySet InstantiatedIReadOnlySet { get; set; } = s_instantiatedIReadOnlySet; public bool IsSameInstantiatedIReadOnlySet() => object.ReferenceEquals(s_instantiatedIReadOnlySet, InstantiatedIReadOnlySet); diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.TestClasses.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.TestClasses.cs index 02f3a74f317b1a..b7ef3cba018edb 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.TestClasses.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.TestClasses.cs @@ -743,7 +743,7 @@ public record RecordWithPrimitives public Uri Prop25 { get; set; } public Version Prop26 { get; set; } public DayOfWeek Prop27 { get; set; } -#if NETCOREAPP +#if NET public Int128 Prop7 { get; set; } public Half Prop11 { get; set; } public UInt128 Prop12 { get; set; } diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs index 22691e75714263..4986778a87ceeb 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs @@ -1971,7 +1971,7 @@ public void TypeWithPrimitives_Pass() #endif Assert.Equal(CultureInfo.GetCultureInfo("yo-NG"), obj.Prop17); -#if NETCOREAPP +#if NET data = @"{ ""Prop7"": 9, ""Prop11"": 65500, @@ -2146,10 +2146,10 @@ public void TraceSwitchTest() TraceSwitch ts = new(displayName: "TraceSwitch", description: "This switch is set via config."); ConfigurationBinder.Bind(config, "TraceSwitch", ts); Assert.Equal(TraceLevel.Info, ts.Level); -#if NETCOREAPP +#if NET // Value property is not publicly exposed in .NET Framework. Assert.Equal("Info", ts.Value); -#endif // NETCOREAPP +#endif // NET } #endif diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Helpers.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Helpers.cs index 24285047fff900..e9dcad70de4f9d 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Helpers.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Helpers.cs @@ -106,7 +106,7 @@ private static async Task VerifyAgainstBaselineUsingF ExpectedDiagnostics expectedDiags = ExpectedDiagnostics.None) { string environmentSubFolder = -#if NETCOREAPP +#if NET "netcoreapp" #else "net462" @@ -138,7 +138,7 @@ private static async Task VerifyAgainstBaselineUsingF string source = string.Join(Environment.NewLine, lines).TrimEnd(Environment.NewLine.ToCharArray()) + Environment.NewLine; path = Path.Combine($"{repoRootDir}\\src\\libraries\\Microsoft.Extensions.Configuration.Binder\\tests\\SourceGenerationTests\\", path); -#if NETCOREAPP +#if NET await File.WriteAllTextAsync(path, source); #else File.WriteAllText(path, source); diff --git a/src/libraries/Microsoft.Extensions.Configuration/src/ConfigurationKeyComparer.cs b/src/libraries/Microsoft.Extensions.Configuration/src/ConfigurationKeyComparer.cs index f00a9ab49f041d..274f4696dd94af 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/src/ConfigurationKeyComparer.cs +++ b/src/libraries/Microsoft.Extensions.Configuration/src/ConfigurationKeyComparer.cs @@ -69,7 +69,7 @@ static ReadOnlySpan SkipAheadOnDelimiter(ReadOnlySpan a) static int Compare(ReadOnlySpan a, ReadOnlySpan b) { -#if NETCOREAPP +#if NET bool aIsInt = int.TryParse(a, out int value1); bool bIsInt = int.TryParse(b, out int value2); #else diff --git a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/DisposableFileSystem.cs b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/DisposableFileSystem.cs index fffca558b0c74d..0c16295d5be547 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/DisposableFileSystem.cs +++ b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/DisposableFileSystem.cs @@ -14,7 +14,7 @@ public class DisposableFileSystem : IDisposable public DisposableFileSystem() { -#if NETCOREAPP +#if NET DirectoryInfo = Directory.CreateTempSubdirectory(); #else DirectoryInfo = new DirectoryInfo(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ActivatorUtilities.cs b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ActivatorUtilities.cs index 0b8a0bacae59e6..6d8a30b6dd5d4e 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ActivatorUtilities.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ActivatorUtilities.cs @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; using Microsoft.Extensions.Internal; -#if NETCOREAPP +#if NET [assembly: System.Reflection.Metadata.MetadataUpdateHandler(typeof(Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ActivatorUtilitiesUpdateHandler))] #endif @@ -23,7 +23,7 @@ namespace Microsoft.Extensions.DependencyInjection /// public static class ActivatorUtilities { -#if NETCOREAPP +#if NET // Support caching of constructor metadata for the common case of types in non-collectible assemblies. private static readonly ConcurrentDictionary s_constructorInfos = new(); @@ -60,7 +60,7 @@ public static object CreateInstance( } ConstructorInfoEx[]? constructors; -#if NETCOREAPP +#if NET if (!s_constructorInfos.TryGetValue(instanceType, out constructors)) { constructors = GetOrAddConstructors(instanceType); @@ -135,7 +135,7 @@ public static object CreateInstance( if (bestLength < length) { bestLength = length; -#if NETCOREAPP +#if NET ctorArgs.CopyTo(bestCtorArgs); #else if (i == constructors.Length - 1) @@ -191,7 +191,7 @@ public static object CreateInstance( matcher.MapParameters(parameterMap, parameters); return matcher.CreateInstance(provider); -#if NETCOREAPP +#if NET int GetMaxArgCount() { int max = 0; @@ -222,7 +222,7 @@ static void InitializeCtorArgValues(ref object[] ctorArgs, int length) #endif } -#if NETCOREAPP +#if NET private static ConstructorInfoEx[] GetOrAddConstructors( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) { @@ -246,7 +246,7 @@ private static ConstructorInfoEx[] GetOrAddConstructors( s_collectibleConstructorInfos.Value.AddOrUpdate(type, value); return value; } -#endif // NETCOREAPP +#endif // NET private static ConstructorInfoEx[] CreateConstructorInfoExs( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) @@ -277,7 +277,7 @@ public static ObjectFactory CreateFactory( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, Type[] argumentTypes) { -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP +#if NETSTANDARD2_1_OR_GREATER || NET if (!RuntimeFeature.IsDynamicCodeCompiled) { // Create a reflection-based factory when dynamic code is not compiled\jitted as would be the case with @@ -314,7 +314,7 @@ public static ObjectFactory CreateFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>( Type[] argumentTypes) { -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP +#if NETSTANDARD2_1_OR_GREATER || NET if (!RuntimeFeature.IsDynamicCodeCompiled) { // See the comment above in the non-generic CreateFactory() for why we use 'IsDynamicCodeCompiled' here. @@ -437,7 +437,7 @@ private static BlockExpression BuildFactoryExpression( Expression.New(constructor, constructorArguments)); } -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP +#if NETSTANDARD2_1_OR_GREATER || NET [DoesNotReturn] private static void ThrowHelperArgumentNullExceptionServiceProvider() { @@ -451,7 +451,7 @@ private static ObjectFactory CreateFactoryReflection( FindApplicableConstructor(instanceType, argumentTypes, constructors: null, out ConstructorInfo constructor, out int?[] parameterMap); Type declaringType = constructor.DeclaringType!; -#if NETCOREAPP +#if NET ConstructorInvoker invoker = ConstructorInvoker.Create(constructor); ParameterInfo[] constructorParameters = constructor.GetParameters(); @@ -520,7 +520,7 @@ ObjectFactory InvokeCanonical() FactoryParameterContext[] parameters = GetFactoryParameterContext(); return (serviceProvider, arguments) => ReflectionFactoryCanonical(constructor, parameters, declaringType, serviceProvider, arguments); -#endif // NETCOREAPP +#endif // NET FactoryParameterContext[] GetFactoryParameterContext() { @@ -542,7 +542,7 @@ FactoryParameterContext[] GetFactoryParameterContext() return parameters; } } -#endif // NETSTANDARD2_1_OR_GREATER || NETCOREAPP +#endif // NETSTANDARD2_1_OR_GREATER || NET private readonly struct FactoryParameterContext { @@ -644,7 +644,7 @@ private static bool TryFindPreferredConstructor( if (constructors is null) { -#if NETCOREAPP +#if NET if (!s_constructorInfos.TryGetValue(instanceType, out constructors)) { constructors = GetOrAddConstructors(instanceType); @@ -725,7 +725,7 @@ private sealed class ConstructorInfoEx public readonly ParameterInfo[] Parameters; public readonly bool IsPreferred; private readonly object?[]? _parameterKeys; -#if NETCOREAPP +#if NET public ConstructorInvoker? _invoker; public ConstructorInvoker Invoker { @@ -801,7 +801,7 @@ private readonly ref struct ConstructorMatcher { private readonly ConstructorInfoEx _constructor; -#if NETCOREAPP +#if NET private readonly Span _parameterValues; public ConstructorMatcher(ConstructorInfoEx constructor, Span parameterValues) #else @@ -884,7 +884,7 @@ public object CreateInstance(IServiceProvider provider) } } -#if NETCOREAPP +#if NET return _constructor.Invoker.Invoke(_parameterValues.Slice(0, _constructor.Parameters.Length)); #else try @@ -922,7 +922,7 @@ private static void ThrowMarkedCtorDoesNotTakeAllProvidedArguments() throw new InvalidOperationException(SR.Format(SR.MarkedCtorMissingArgumentTypes, nameof(ActivatorUtilitiesConstructorAttribute))); } -#if NETCOREAPP // Use the faster ConstructorInvoker which also has alloc-free APIs when <= 4 parameters. +#if NET // Use the faster ConstructorInvoker which also has alloc-free APIs when <= 4 parameters. private static object ReflectionFactoryServiceOnlyFixed( ConstructorInvoker invoker, FactoryParameterContext[] parameters, @@ -1167,7 +1167,7 @@ private static void ThrowHelperNullReferenceException() { throw new NullReferenceException(); } -#elif NETSTANDARD2_1_OR_GREATER || NETCOREAPP +#elif NETSTANDARD2_1_OR_GREATER || NET private static object ReflectionFactoryCanonical( ConstructorInfo constructor, FactoryParameterContext[] parameters, @@ -1197,7 +1197,7 @@ private static object ReflectionFactoryCanonical( } #endif -#if NETCOREAPP +#if NET internal static class ActivatorUtilitiesUpdateHandler { public static void ClearCache(Type[]? _) diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ActivatorUtilitiesTests.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ActivatorUtilitiesTests.cs index 1144ff33a1c7b6..8e0d07c0b0acd4 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ActivatorUtilitiesTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ActivatorUtilitiesTests.cs @@ -8,7 +8,7 @@ using Xunit; using System.Runtime.CompilerServices; -#if NETCOREAPP +#if NET using System.Runtime.Loader; #endif @@ -332,7 +332,7 @@ public void CreateFactory_CreatesFactoryMethod_5Types_5Injected() [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] -#if NETCOREAPP +#if NET [InlineData(false)] #endif public void CreateFactory_CreatesFactoryMethod_KeyedParams(bool useDynamicCode) @@ -363,7 +363,7 @@ public void CreateFactory_CreatesFactoryMethod_KeyedParams(bool useDynamicCode) [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] -#if NETCOREAPP +#if NET [InlineData(false)] #endif public void CreateFactory_CreatesFactoryMethod_KeyedParams_5Types(bool useDynamicCode) @@ -396,7 +396,7 @@ public void CreateFactory_CreatesFactoryMethod_KeyedParams_5Types(bool useDynami [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] -#if NETCOREAPP +#if NET [InlineData(false)] #endif public void CreateFactory_CreatesFactoryMethod_KeyedParams_1Injected(bool useDynamicCode) @@ -426,7 +426,7 @@ public void CreateFactory_CreatesFactoryMethod_KeyedParams_1Injected(bool useDyn [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] -#if NETCOREAPP +#if NET [InlineData(false)] #endif public void CreateFactory_RemoteExecutor_CreatesFactoryMethod(bool useDynamicCode) @@ -460,7 +460,7 @@ public void CreateFactory_RemoteExecutor_CreatesFactoryMethod(bool useDynamicCod [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] -#if NETCOREAPP +#if NET [InlineData(false)] #endif public void CreateFactory_RemoteExecutor_NullArguments_Throws(bool useDynamicCode) @@ -483,7 +483,7 @@ public void CreateFactory_RemoteExecutor_NullArguments_Throws(bool useDynamicCod [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] -#if NETCOREAPP +#if NET [InlineData(false)] #endif public void CreateFactory_RemoteExecutor_NoArguments_UseNullDefaultValue(bool useDynamicCode) @@ -507,7 +507,7 @@ public void CreateFactory_RemoteExecutor_NoArguments_UseNullDefaultValue(bool us [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] -#if NETCOREAPP +#if NET [InlineData(false)] #endif public void CreateFactory_RemoteExecutor_NoArguments_ThrowRequiredValue(bool useDynamicCode) @@ -531,7 +531,7 @@ public void CreateFactory_RemoteExecutor_NoArguments_ThrowRequiredValue(bool use [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] -#if NETCOREAPP +#if NET [InlineData(false)] #endif public void CreateFactory_RemoteExecutor_NullArgument_UseDefaultValue(bool useDynamicCode) @@ -555,7 +555,7 @@ public void CreateFactory_RemoteExecutor_NullArgument_UseDefaultValue(bool useDy [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] -#if NETCOREAPP +#if NET [InlineData(false)] #endif public void CreateFactory_RemoteExecutor_NoParameters_Success(bool useDynamicCode) @@ -577,7 +577,7 @@ public void CreateFactory_RemoteExecutor_NoParameters_Success(bool useDynamicCod }, options); } -#if NETCOREAPP +#if NET [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [InlineData(true)] @@ -1008,7 +1008,7 @@ public ClassWithStringDefaultValue(string text = "DEFAULT") } } -#if NETCOREAPP +#if NET internal class MyLoadContext : AssemblyLoadContext { private MyLoadContext() : base(isCollectible: true) diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs index b5c6730eef3eec..298b704ac1c288 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs @@ -40,7 +40,7 @@ private static DependencyContextPaths GetCurrent() internal static DependencyContextPaths Create(string? depsFiles, string? sharedRuntime) { -#if NETCOREAPP +#if NET const char separator = ';'; #else // This method is only executed once at startup. No need to cache the char[]. diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/MockFileProvider.cs b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/MockFileProvider.cs index c9ce31d6e276d5..eed6a5044e6aca 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/MockFileProvider.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/MockFileProvider.cs @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.FileProviders.Composite { public class MockFileProvider : IFileProvider { -#if NETCOREAPP +#if NET static MockFileProvider() { // Castle DynamicProxy hasn't been updated to ignore .net5 infrastructure attributes diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/FileSystemInfoHelper.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/FileSystemInfoHelper.cs index 6559d5d46c9fc1..4796d4a8b0a390 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/FileSystemInfoHelper.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/FileSystemInfoHelper.cs @@ -31,7 +31,7 @@ public static bool IsExcluded(FileSystemInfo fileSystemInfo, ExclusionFilters fi public static DateTime? GetFileLinkTargetLastWriteTimeUtc(string filePath) { -#if NETCOREAPP +#if NET var fileInfo = new FileInfo(filePath); if (fileInfo.Exists) { @@ -47,7 +47,7 @@ public static bool IsExcluded(FileSystemInfo fileSystemInfo, ExclusionFilters fi // If file is not a link, return null to inform the caller that file is not a link. public static DateTime? GetFileLinkTargetLastWriteTimeUtc(FileInfo fileInfo) { -#if NETCOREAPP +#if NET Debug.Assert(fileInfo.Exists); if (fileInfo.LinkTarget != null) { diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs index fb2306d56e9f9d..925df9892752b6 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs @@ -162,7 +162,7 @@ internal PhysicalFilesWatcher CreateFileWatcher() string root = PathUtils.EnsureTrailingSlash(Path.GetFullPath(Root)); FileSystemWatcher? watcher; -#if NETCOREAPP +#if NET // For browser/iOS/tvOS we will proactively fallback to polling since FileSystemWatcher is not supported. if (OperatingSystem.IsBrowser() || (OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS()) { diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs index eaa53fec71ede1..712a83a3ef2c6e 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs @@ -88,7 +88,7 @@ public PhysicalFilesWatcher( if (fileSystemWatcher != null) { -#if NETCOREAPP +#if NET if (OperatingSystem.IsBrowser() || (OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS()) { throw new PlatformNotSupportedException(SR.Format(SR.FileSystemWatcher_PlatformNotSupported, typeof(FileSystemWatcher))); diff --git a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/TestUtility/DisposableFileSystem.cs b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/TestUtility/DisposableFileSystem.cs index 50abfa57af42e3..1571b88402ec0b 100644 --- a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/TestUtility/DisposableFileSystem.cs +++ b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/TestUtility/DisposableFileSystem.cs @@ -10,7 +10,7 @@ public class DisposableFileSystem : IDisposable { public DisposableFileSystem() { -#if NETCOREAPP +#if NET DirectoryInfo = Directory.CreateTempSubdirectory(); #else DirectoryInfo = new DirectoryInfo(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); diff --git a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdHelpers.cs b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdHelpers.cs index c7887bc29b2302..53d382c5e7c913 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdHelpers.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdHelpers.cs @@ -5,7 +5,7 @@ using System.Globalization; using System.IO; using System.Text; -#if !NETCOREAPP +#if !NET using System.Diagnostics; #endif @@ -37,7 +37,7 @@ private static bool GetIsSystemdService() // To support containerized systemd services, check if we're the main process (PID 1) // and if there are systemd environment variables defined for notifying the service // manager, or passing listen handles. -#if NETCOREAPP +#if NET int processId = Environment.ProcessId; #else int processId = Process.GetCurrentProcess().Id; diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs b/src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs index a0407b8c2ec7be..09274bad3a3cbb 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs @@ -275,7 +275,7 @@ internal static void AddDefaultServices(HostBuilderContext hostingContext, IServ services.AddLogging(logging => { bool isWindows = -#if NETCOREAPP +#if NET OperatingSystem.IsWindows(); #elif NETFRAMEWORK Environment.OSVersion.Platform == PlatformID.Win32NT; @@ -292,7 +292,7 @@ internal static void AddDefaultServices(HostBuilderContext hostingContext, IServ } logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); -#if NETCOREAPP +#if NET if (!OperatingSystem.IsBrowser()) #endif { diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostApplicationBuilderTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostApplicationBuilderTests.cs index d2167ae3697f82..f923221fdb7b6e 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostApplicationBuilderTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostApplicationBuilderTests.cs @@ -255,7 +255,7 @@ public void DisableDefaultIHostEnvironmentValues(CreateBuilderFunc createBuilder HostApplicationBuilder builder = createBuilder(); Assert.Equal(Environments.Production, builder.Environment.EnvironmentName); -#if NETCOREAPP +#if NET Assert.NotNull(builder.Environment.ApplicationName); #elif NETFRAMEWORK // Note GetEntryAssembly returns null for the net4x console test runner. @@ -270,7 +270,7 @@ public void DisableDefaultIHostEnvironmentValues(CreateBuilderFunc createBuilder var env = host.Services.GetRequiredService(); Assert.Equal(Environments.Production, env.EnvironmentName); -#if NETCOREAPP +#if NET Assert.NotNull(env.ApplicationName); #elif NETFRAMEWORK // Note GetEntryAssembly returns null for the net4x console test runner. @@ -382,7 +382,7 @@ public void DirectSettingsOverrideConfigurationSetting(CreateBuilderSettingsFunc private static string CreateTempSubdirectory() { -#if NETCOREAPP +#if NET DirectoryInfo directoryInfo = Directory.CreateTempSubdirectory(); #else DirectoryInfo directoryInfo = new DirectoryInfo(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostBuilderTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostBuilderTests.cs index 5d37dbd15ec333..da863fec653535 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostBuilderTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostBuilderTests.cs @@ -174,7 +174,7 @@ public void DefaultIHostEnvironmentValues() { var env = hostContext.HostingEnvironment; Assert.Equal(Environments.Production, env.EnvironmentName); -#if NETCOREAPP +#if NET Assert.NotNull(env.ApplicationName); #elif NETFRAMEWORK // Note GetEntryAssembly returns null for the net4x console test runner. @@ -190,7 +190,7 @@ public void DefaultIHostEnvironmentValues() { var env = host.Services.GetRequiredService(); Assert.Equal(Environments.Production, env.EnvironmentName); -#if NETCOREAPP +#if NET Assert.NotNull(env.ApplicationName); #elif NETFRAMEWORK // Note GetEntryAssembly returns null for the net4x console test runner. diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/OptionsBuilderExtensionsTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/OptionsBuilderExtensionsTests.cs index 74c2a1c0bfe92c..6a67cbcaa9508e 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/OptionsBuilderExtensionsTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/OptionsBuilderExtensionsTests.cs @@ -413,7 +413,7 @@ private static void ValidateFailure(Type type, OptionsValidationException e, int // Check for the error in any of the failures foreach (var error in errorsToMatch) { -#if NETCOREAPP +#if NET Assert.True(e.Failures.FirstOrDefault(predicate: f => f.Contains(error, StringComparison.CurrentCulture)) != null, "Did not find: " + error + " " + e.Failures.First()); #else Assert.True(e.Failures.FirstOrDefault(predicate: f => f.IndexOf(error, StringComparison.CurrentCulture) >= 0) != null, "Did not find: " + error + " " + e.Failures.First()); diff --git a/src/libraries/Microsoft.Extensions.Http/src/Logging/HttpHeadersLogValue.cs b/src/libraries/Microsoft.Extensions.Http/src/Logging/HttpHeadersLogValue.cs index 802192c4a905c9..23b07adf7f503d 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/Logging/HttpHeadersLogValue.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/Logging/HttpHeadersLogValue.cs @@ -103,7 +103,7 @@ public override string ToString() } else { -#if NETCOREAPP +#if NET builder.AppendJoin(", ", (IEnumerable)kvp.Value); builder.AppendLine(); #else diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs index 8cab45f3ffc06b..563fcacac6dadf 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs @@ -62,7 +62,7 @@ private void WriteToConsole(string message, int startIndex, int length, ConsoleC { ReadOnlySpan span = message.AsSpan(startIndex, length); var colorChanged = SetColor(background, foreground); -#if NETCOREAPP +#if NET _textWriter.Write(span); #else _textWriter.Write(span.ToString()); diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs index b3ff45e33d9ed1..3b613ac50e206a 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs @@ -81,7 +81,7 @@ private void WriteInternal(IExternalScopeProvider? scopeProvider, TextWriter tex writer.WriteEndObject(); writer.Flush(); } -#if NETCOREAPP +#if NET textWriter.Write(Encoding.UTF8.GetString(output.WrittenMemory.Span)); #else textWriter.Write(Encoding.UTF8.GetString(output.WrittenMemory.Span.ToArray())); @@ -145,7 +145,7 @@ private static void WriteItem(Utf8JsonWriter writer, KeyValuePair OperatingSystem.IsAndroid() || OperatingSystem.IsTvOS() || OperatingSystem.IsIOS(); // returns true on MacCatalyst @@ -90,7 +90,7 @@ private void WriteInternal(IExternalScopeProvider? scopeProvider, TextWriter tex textWriter.Write(category); textWriter.Write('['); -#if NETCOREAPP +#if NET Span span = stackalloc char[10]; if (eventId.TryFormat(span, out int charsWritten)) textWriter.Write(span.Slice(0, charsWritten)); diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/tests/EventSourceLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging.EventSource/tests/EventSourceLoggerTest.cs index 343036cca5b5ce..eb4f25eb34fc5d 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventSource/tests/EventSourceLoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/tests/EventSourceLoggerTest.cs @@ -904,7 +904,7 @@ private static class EventTypes @"""FormattedMessage"":""Logger2 Event5 Critical bar 23 45") }, // Starting in netcoreapp3.0 Exception.ToString() puts a newline before inner exceptions -#if NETCOREAPP +#if NET { "E5JS", (e) => VerifySingleEvent(e, "Logger2", EventTypes.MessageJson, 5, null, LogLevel.Critical, @"""ArgumentsJson"":{""stringParam"":""bar"",""int1Param"":""23"",""int2Param"":""45""", @$"""ExceptionJson"":{{""TypeName"":""System.Exception"",""Message"":""oops"",""HResult"":""-2146233088"",""VerboseMessage"":""System.Exception: oops{EscapedNewline()} ---\u003E System.Exception: inner oops") }, diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerProviderTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerProviderTest.cs index 80d9e7ab1909a0..83dd9e8b619bff 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerProviderTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerProviderTest.cs @@ -66,7 +66,7 @@ public override void WriteLine(string message) } } } -#elif NETCOREAPP +#elif NET #else #error Target framework needs to be updated #endif diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceScopeTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceScopeTest.cs index 25bd315a8679b0..42c16ecd30bba7 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceScopeTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceScopeTest.cs @@ -33,7 +33,7 @@ public static void DiagnosticsScope_PushesAndPops_LogicalOperationStack() Assert.Same(a, c); Assert.Same(state, b); } -#elif NETCOREAPP +#elif NET #else #error Target framework needs to be updated #endif diff --git a/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs b/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs index 618c751d281059..5a3479b42c3568 100644 --- a/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs +++ b/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs @@ -56,11 +56,11 @@ public partial struct MyOptionsValidator : IValidateOptions Assert.Empty(diagnostics); _ = Assert.Single(generatedSources); -#if NETCOREAPP +#if NET string generatedSource = File.ReadAllText(@"Baselines/EmitterWithCustomValidator.netcore.g.cs"); #else string generatedSource = File.ReadAllText(@"Baselines/EmitterWithCustomValidator.netfx.g.cs"); -#endif // NETCOREAPP +#endif // NET Assert.Equal(generatedSource.Replace("\r\n", "\n"), generatedSources[0].SourceText.ToString().Replace("\r\n", "\n")); } @@ -1715,7 +1715,7 @@ private static CSharpCompilation CreateCompilationForOptionsSource(string assemb public async Task GeneratedAttributesTest(LanguageVersion languageVersion) { -#if NETCOREAPP +#if NET string lengthAttribute = $$""" [LengthAttribute(1, 3)] public string? P0 { get; set; } @@ -1728,7 +1728,7 @@ public async Task GeneratedAttributesTest(LanguageVersion languageVersion) """; #else string lengthAttribute = ""; -#endif //NETCOREAPP +#endif //NET string source = $$""" using System; @@ -1807,7 +1807,7 @@ public sealed partial class OptionsUsingGeneratedAttributesValidator : IValidate var diags = syntaxTree.GetDiagnostics().ToArray(); Assert.Empty(diags); -#if NETCOREAPP +#if NET string generatedSource = File.ReadAllText(languageVersion == LanguageVersion.CSharp10 ? @"Baselines/GeneratedAttributesTest.netcore.lang10.g.cs" : @"Baselines/GeneratedAttributesTest.netcore.lang11.g.cs"); #else string generatedSource = File.ReadAllText(languageVersion == LanguageVersion.CSharp10 ? @"Baselines/GeneratedAttributesTest.netfx.lang10.g.cs" : @"Baselines/GeneratedAttributesTest.netfx.lang11.g.cs"); @@ -1857,11 +1857,11 @@ public partial class MyOptionsValidator : IValidateOptions Assert.Empty(diagnostics); Assert.Single(generatedSources); -#if NETCOREAPP +#if NET string generatedSource = File.ReadAllText(@"Baselines/UsingInterfaceAsPropertyTypeForLengthAttributesTests.netcore.g.cs"); #else string generatedSource = File.ReadAllText(@"Baselines/UsingInterfaceAsPropertyTypeForLengthAttributesTests.netfx.g.cs"); -#endif // NETCOREAPP +#endif // NET Assert.Equal(generatedSource.Replace("\r\n", "\n"), generatedSources[0].SourceText.ToString().Replace("\r\n", "\n")); } @@ -1907,11 +1907,11 @@ public sealed class EndPointsOptions var (diagnostics, src) = await RunGenerator(source); Assert.Empty(diagnostics); Assert.Single(src); -#if NETCOREAPP +#if NET string generatedSource = File.ReadAllText(@"Baselines/OptionsExtendingSystemClassTest.netcore.g.cs"); #else string generatedSource = File.ReadAllText(@"Baselines/OptionsExtendingSystemClassTest.netfx.g.cs"); -#endif // NETCOREAPP +#endif // NET Assert.Equal(generatedSource.Replace("\r\n", "\n"), src[0].SourceText.ToString().Replace("\r\n", "\n")); } } diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs index c78527db921b5d..f91f2314439cae 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs @@ -271,7 +271,7 @@ public bool Equals(string? text, StringComparison comparisonType) [MethodImpl(MethodImplOptions.AggressiveInlining)] public override int GetHashCode() { -#if NETCOREAPP +#if NET return string.GetHashCode(AsSpan()); #elif (NETSTANDARD2_0 || NETFRAMEWORK) // This GetHashCode is expensive since it allocates on every call. diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs index 9942f7959f5bdf..f1c645483da8f4 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs @@ -61,7 +61,7 @@ public bool Equals(StringSegment x, StringSegment y) /// A hash code for a , suitable for use in hashing algorithms and data structures like a hash table. public int GetHashCode(StringSegment obj) { -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 return string.GetHashCode(obj.AsSpan(), Comparison); #else if (!obj.HasValue) diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs index 45cfea152227dc..591830f3bec384 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs @@ -219,7 +219,7 @@ static string GetJoinedStringValueFromArray(string?[] values) length += value.Length; } } -#if NETCOREAPP +#if NET // Create the new string return string.Create(length, values, (span, strings) => { int offset = 0; diff --git a/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs b/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs index e83798d5d6e2c2..58f468d7c8fa97 100644 --- a/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs +++ b/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs @@ -865,7 +865,7 @@ protected override void GenerateArrayCreateExpression(CodeArrayCreateExpression string typeName = GetTypeOutput(e.CreateType); Output.Write(typeName); -#if NETCOREAPP +#if NET if (!typeName.Contains('(')) #else if (typeName.IndexOf('(') == -1) @@ -892,7 +892,7 @@ protected override void GenerateArrayCreateExpression(CodeArrayCreateExpression } else { -#if NETCOREAPP +#if NET Output.Write(typeName.AsSpan(0, index + 1)); #else Output.Write(typeName.Substring(0, index + 1)); @@ -917,7 +917,7 @@ protected override void GenerateArrayCreateExpression(CodeArrayCreateExpression } else { -#if NETCOREAPP +#if NET Output.Write(typeName.AsSpan(index + 1)); #else Output.Write(typeName.Substring(index + 1)); diff --git a/src/libraries/System.CodeDom/tests/System/CodeDom/TempFileCollectionTests.cs b/src/libraries/System.CodeDom/tests/System/CodeDom/TempFileCollectionTests.cs index 7162c9358fdd3c..0fce53d4f8772d 100644 --- a/src/libraries/System.CodeDom/tests/System/CodeDom/TempFileCollectionTests.cs +++ b/src/libraries/System.CodeDom/tests/System/CodeDom/TempFileCollectionTests.cs @@ -277,7 +277,7 @@ private static string TempDirectory() { if (s_tempDirectory == null) { -#if NETCOREAPP +#if NET string tempDirectory = Directory.CreateTempSubdirectory().FullName; #else string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 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 3c2f745f3c0c3c..8a6933a4039bf8 100644 --- a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs +++ b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs @@ -572,7 +572,7 @@ public static partial class ImmutableHashSet } [System.Runtime.CompilerServices.CollectionBuilderAttribute(typeof(System.Collections.Immutable.ImmutableHashSet), "Create")] -#if NETCOREAPP +#if NET public sealed partial class ImmutableHashSet : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.ISet, System.Collections.Generic.IReadOnlySet, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.Immutable.IImmutableSet #else public sealed partial class ImmutableHashSet : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.ISet, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.Immutable.IImmutableSet @@ -1073,7 +1073,7 @@ public static partial class ImmutableSortedSet } [System.Runtime.CompilerServices.CollectionBuilderAttribute(typeof(System.Collections.Immutable.ImmutableSortedSet), "Create")] -#if NETCOREAPP +#if NET public sealed partial class ImmutableSortedSet : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.Generic.ISet, System.Collections.Generic.IReadOnlySet, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.Immutable.IImmutableSet #else public sealed partial class ImmutableSortedSet : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.Generic.ISet, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.Immutable.IImmutableSet diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/AllocFreeConcurrentStack.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/AllocFreeConcurrentStack.cs index ad22b0bbab6952..1f1b1be4c5bf37 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/AllocFreeConcurrentStack.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/AllocFreeConcurrentStack.cs @@ -10,7 +10,7 @@ internal static class AllocFreeConcurrentStack { private const int MaxSize = 35; -#if NETCOREAPP +#if NET [ThreadStatic] private static Stack>? t_stack; #else @@ -20,7 +20,7 @@ internal static class AllocFreeConcurrentStack public static void TryAdd(T item) { Stack> localStack = -#if NETCOREAPP +#if NET t_stack ??= new Stack>(MaxSize); #else ThreadLocalStack; @@ -36,7 +36,7 @@ public static void TryAdd(T item) public static bool TryTake([MaybeNullWhen(false)] out T item) { -#if NETCOREAPP +#if NET Stack>? localStack = t_stack; // cache in a local to avoid unnecessary TLS hits on repeated accesses #else Stack> localStack = ThreadLocalStack; @@ -51,7 +51,7 @@ public static bool TryTake([MaybeNullWhen(false)] out T item) return false; } -#if !NETCOREAPP +#if !NET private static Stack> ThreadLocalStack { get @@ -73,7 +73,7 @@ private static Stack> ThreadLocalStack #endif } -#if !NETCOREAPP +#if !NET internal static class AllocFreeConcurrentStack { // Workaround for https://github.com/dotnet/runtime/issues/4731. diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.cs index 823c5e04cd279d..8d941eb0bcec12 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.cs @@ -16,7 +16,7 @@ internal static partial class ImmutableExtensions { internal static bool IsValueType() { -#if NETCOREAPP +#if NET return typeof(T).IsValueType; #else if (default(T) != null) diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs index b2e073484bb4ad..2ff4b68d19af36 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs @@ -15,7 +15,7 @@ namespace System.Collections.Immutable [CollectionBuilder(typeof(ImmutableHashSet), nameof(ImmutableHashSet.Create))] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableEnumerableDebuggerProxy<>))] -#if NETCOREAPP +#if NET public sealed partial class ImmutableHashSet : IImmutableSet, IHashKeyCollection, IReadOnlyCollection, ICollection, ISet, IReadOnlySet, ICollection, IStrongEnumerable.Enumerator> #else public sealed partial class ImmutableHashSet : IImmutableSet, IHashKeyCollection, IReadOnlyCollection, ICollection, ISet, ICollection, IStrongEnumerable.Enumerator> 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 2befd4a7c1307d..ee1d369c6ea144 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 @@ -20,7 +20,7 @@ namespace System.Collections.Immutable [CollectionBuilder(typeof(ImmutableSortedSet), nameof(ImmutableSortedSet.Create))] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableEnumerableDebuggerProxy<>))] -#if NETCOREAPP +#if NET public sealed partial class ImmutableSortedSet : IImmutableSet, ISortKeyCollection, IReadOnlySet, IReadOnlyList, IList, ISet, IList, IStrongEnumerable.Enumerator> #else public sealed partial class ImmutableSortedSet : IImmutableSet, ISortKeyCollection, IReadOnlyList, IList, ISet, IList, IStrongEnumerable.Enumerator> diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs index 7223c1305e9c62..e522f4cff834ea 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs @@ -793,7 +793,7 @@ public static void TestDebuggerAttributes_Null() Assert.IsType(tie.InnerException); } -#if NETCOREAPP +#if NET [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void UsableWithCollectibleAssemblies() { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs index 95ea38065458f1..75744ec2c1d30c 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs @@ -22,7 +22,7 @@ namespace System.ComponentModel.Composition.Hosting public partial class DirectoryCatalog : ComposablePartCatalog, INotifyComposablePartCatalogChanged, ICompositionElement { private static bool IsWindows => -#if NETCOREAPP_5_0_OR_GREATER +#if NET OperatingSystem.IsWindows(); #else RuntimeInformation.IsOSPlatform(OSPlatform.Windows); diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationLockCollection.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationLockCollection.cs index de0d3af555f8d9..8f5c8c9f37c3c4 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationLockCollection.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationLockCollection.cs @@ -220,7 +220,7 @@ internal bool DefinedInParent(string name) string parentListEnclosed = "," + _seedList + ","; if (name.Equals(_ignoreName) || -#if NETCOREAPP +#if NET parentListEnclosed.Contains("," + name + ",", StringComparison.Ordinal)) #else parentListEnclosed.IndexOf("," + name + ",", StringComparison.Ordinal) >= 0) diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationProperty.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationProperty.cs index f401066ddd8d20..959ba9bd9ed54e 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationProperty.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationProperty.cs @@ -133,7 +133,7 @@ internal ConfigurationProperty(PropertyInfo info) if (collectionAttribute != null) { -#if NETCOREAPP +#if NET if (!collectionAttribute.AddItemName.Contains(',')) #else if (collectionAttribute.AddItemName.IndexOf(',') == -1) diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSectionCollection.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSectionCollection.cs index b103a4a35a26c8..ef54b46ac03182 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSectionCollection.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSectionCollection.cs @@ -88,7 +88,7 @@ public ConfigurationSection Get(string name) throw ExceptionUtil.ParameterNullOrEmpty(nameof(name)); // prevent GetConfig from returning config not in this collection -#if NETCOREAPP +#if NET if (name.Contains('/')) #else if (name.IndexOf('/') >= 0) diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSectionGroupCollection.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSectionGroupCollection.cs index 68157107c77a7e..81210e851119e6 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSectionGroupCollection.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSectionGroupCollection.cs @@ -92,7 +92,7 @@ public ConfigurationSectionGroup Get(string name) throw ExceptionUtil.ParameterNullOrEmpty(nameof(name)); // prevent GetConfig from returning config not in this collection -#if NETCOREAPP +#if NET if (name.Contains('/')) #else if (name.IndexOf('/') >= 0) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs index e1678dc3dda86a..4d4edfbf7b798f 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs @@ -1362,7 +1362,7 @@ public static PropertyFetch FetcherForProperty(Type? type, string propertyName) private static PropertyFetch CreateEnumeratePropertyFetch(Type type, TypeInfo enumerableOfTType) { Type elemType = enumerableOfTType.GetGenericArguments()[0]; -#if NETCOREAPP +#if NET if (!RuntimeFeature.IsDynamicCodeSupported && elemType.IsValueType) { return new EnumeratePropertyFetch(type); @@ -1377,7 +1377,7 @@ private static PropertyFetch CreateEnumeratePropertyFetch(Type type, TypeInfo en Justification = "MakeGenericType is only called when IsDynamicCodeSupported is true or only with ref types.")] private static PropertyFetch CreatePropertyFetch(Type type, PropertyInfo propertyInfo) { -#if NETCOREAPP +#if NET if (!RuntimeFeature.IsDynamicCodeSupported && (propertyInfo.DeclaringType!.IsValueType || propertyInfo.PropertyType.IsValueType)) { return new ReflectionPropertyFetch(type, propertyInfo); @@ -1434,7 +1434,7 @@ public ValueTypedFetchProperty(Type type, PropertyInfo property) : base(type) private readonly StructFunc _propertyFetch; } -#if NETCOREAPP +#if NET /// /// A fetcher that can be used when MakeGenericType isn't available. /// diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs index a3c443b0a38f11..ba789aa98b15bf 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs @@ -737,7 +737,7 @@ private static string FormatQuantiles(QuantileValue[] quantiles) StringBuilder sb = new StringBuilder(); for (int i = 0; i < quantiles.Length; i++) { -#if NETCOREAPP +#if NET sb.Append(CultureInfo.InvariantCulture, $"{quantiles[i].Quantile}={quantiles[i].Value}"); #else sb.AppendFormat(CultureInfo.InvariantCulture, "{0}={1}", quantiles[i].Quantile, quantiles[i].Value); 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 f6b7737ef81ab2..2f7e0847782aca 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs @@ -13,7 +13,7 @@ using Microsoft.Win32; using static Interop.Advapi32; -#if !NETCOREAPP +#if !NET using MemoryMarshal = System.Diagnostics.PerformanceCounterLib; #endif @@ -120,7 +120,7 @@ internal static string ComputerName } } -#if !NETCOREAPP +#if !NET internal static T Read(ReadOnlySpan span) where T : struct => System.Runtime.InteropServices.MemoryMarshal.Read(span); diff --git a/src/libraries/System.DirectoryServices.Protocols/tests/DirectoryServicesTestHelpers.cs b/src/libraries/System.DirectoryServices.Protocols/tests/DirectoryServicesTestHelpers.cs index fb663740108b08..422c37e70dbb30 100644 --- a/src/libraries/System.DirectoryServices.Protocols/tests/DirectoryServicesTestHelpers.cs +++ b/src/libraries/System.DirectoryServices.Protocols/tests/DirectoryServicesTestHelpers.cs @@ -22,7 +22,7 @@ public static bool IsLibLdapInstalled { get { -#if NETCOREAPP +#if NET if (!_isLibLdapInstalled.HasValue) { if (PlatformDetection.IsApplePlatform) diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnCharacterStringEncodings.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnCharacterStringEncodings.cs index 48ae19cce80c90..e13d5ddfd6f7b0 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnCharacterStringEncodings.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnCharacterStringEncodings.cs @@ -100,7 +100,7 @@ public override int GetByteCount(string s) } public -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 override #endif int GetByteCount(ReadOnlySpan chars) @@ -135,7 +135,7 @@ public override unsafe int GetCharCount(byte* bytes, int count) } public -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 override #endif int GetCharCount(ReadOnlySpan bytes) @@ -435,7 +435,7 @@ public override int GetByteCount(string s) return s_utf8Encoding.GetByteCount(s); } -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 public override int GetByteCount(ReadOnlySpan chars) { return s_utf8Encoding.GetByteCount(chars); @@ -476,7 +476,7 @@ public override unsafe int GetCharCount(byte* bytes, int count) } } -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 public override int GetCharCount(ReadOnlySpan bytes) { try diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs index fac90e12aec1c2..33e5a0adb1c986 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs @@ -61,7 +61,7 @@ public static string ReadObjectIdentifier( UniversalTagNumber.ObjectIdentifier, out int consumed); -#if NETCOREAPP +#if NET string? wellKnown = WellKnownOids.GetValue(contents); if (wellKnown is not null) diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Oid.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Oid.cs index 7c046016c531b2..04a063a11fdc31 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Oid.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Oid.cs @@ -59,7 +59,7 @@ public void WriteObjectIdentifier(ReadOnlySpan oidValue, Asn1Tag? tag = nu { CheckUniversalTag(tag, UniversalTagNumber.ObjectIdentifier); -#if NETCOREAPP +#if NET ReadOnlySpan wellKnownContents = WellKnownOids.GetContents(oidValue); if (!wellKnownContents.IsEmpty) diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/WellKnownOids.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/WellKnownOids.cs index c308c5af7fd5db..215dbe5eb846f1 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/WellKnownOids.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/WellKnownOids.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#if NETCOREAPP +#if NET namespace System.Formats.Asn1 { internal static class WellKnownOids diff --git a/src/libraries/System.Formats.Asn1/tests/Reader/ReadIA5String.cs b/src/libraries/System.Formats.Asn1/tests/Reader/ReadIA5String.cs index b7a74a95c3ff60..b11db277363c88 100644 --- a/src/libraries/System.Formats.Asn1/tests/Reader/ReadIA5String.cs +++ b/src/libraries/System.Formats.Asn1/tests/Reader/ReadIA5String.cs @@ -678,7 +678,7 @@ public static void ExpectedTag_IgnoresConstructed( Assert.Equal(val1.ByteArrayToHex(), val2.ByteArrayToHex()); -#if NETCOREAPP +#if NET string expected = Encoding.ASCII.GetString(val1.Span); #else string expected = Encoding.ASCII.GetString(val1.ToArray()); diff --git a/src/libraries/System.Formats.Cbor/src/System/Formats/Cbor/CborConformanceLevel.cs b/src/libraries/System.Formats.Cbor/src/System/Formats/Cbor/CborConformanceLevel.cs index b31bbbcd62a2a3..b46066f061a5bc 100644 --- a/src/libraries/System.Formats.Cbor/src/System/Formats/Cbor/CborConformanceLevel.cs +++ b/src/libraries/System.Formats.Cbor/src/System/Formats/Cbor/CborConformanceLevel.cs @@ -207,7 +207,7 @@ public static bool RequireCanonicalSimpleValueEncodings(CborConformanceMode conf public static int GetKeyEncodingHashCode(ReadOnlySpan encoding) { HashCode hash = default; -#if NETCOREAPP +#if NET hash.AddBytes(encoding); #else while (encoding.Length >= sizeof(int)) diff --git a/src/libraries/System.Formats.Cbor/src/System/Formats/Cbor/Writer/CborWriter.cs b/src/libraries/System.Formats.Cbor/src/System/Formats/Cbor/Writer/CborWriter.cs index 988b79dae85f47..9354a772f64fde 100644 --- a/src/libraries/System.Formats.Cbor/src/System/Formats/Cbor/Writer/CborWriter.cs +++ b/src/libraries/System.Formats.Cbor/src/System/Formats/Cbor/Writer/CborWriter.cs @@ -241,7 +241,7 @@ private void EnsureWriteCapacity(int pendingCount) { int newCapacity = currentCapacity == 0 ? 1024 : currentCapacity * 2; const uint MaxArrayLength = 0x7FFFFFC7; // Array.MaxLength -#if NETCOREAPP +#if NET Debug.Assert(MaxArrayLength == Array.MaxLength); #endif if ((uint)newCapacity > MaxArrayLength || newCapacity < requiredCapacity) diff --git a/src/libraries/System.Formats.Cbor/tests/Reader/CborReaderTests.TextString.cs b/src/libraries/System.Formats.Cbor/tests/Reader/CborReaderTests.TextString.cs index 4f6acad8e5287c..314592bb6f0099 100644 --- a/src/libraries/System.Formats.Cbor/tests/Reader/CborReaderTests.TextString.cs +++ b/src/libraries/System.Formats.Cbor/tests/Reader/CborReaderTests.TextString.cs @@ -106,7 +106,7 @@ public static void TryReadTextString_IndefiniteLengthConcatenated_SingleValue__H Assert.True(result); Assert.Equal(expectedValue.Length, charsWritten); Assert.Equal(expectedValue, new string(buffer.Slice(0, charsWritten) -#if !NETCOREAPP +#if !NET .ToArray() #endif )); @@ -136,7 +136,7 @@ public static void TryReadTextString_BufferTooSmall_ShouldReturnFalse(string act Assert.True(result); Assert.Equal(actualValue.Length, charsWritten); Assert.Equal(actualValue, new string(buffer.AsSpan(0, charsWritten) -#if !NETCOREAPP +#if !NET .ToArray() #endif )); @@ -162,7 +162,7 @@ public static void TryReadTextString_IndefiniteLengthConcatenated_BufferTooSmall Assert.True(result); Assert.Equal(expectedValue.Length, charsWritten); Assert.Equal(expectedValue, new string(buffer.AsSpan(0, charsWritten) -#if !NETCOREAPP +#if !NET .ToArray() #endif )); @@ -184,7 +184,7 @@ public static void ReadDefiniteLengthTextStringBytes_SingleValue_HappyPath(strin ReadOnlyMemory resultBytes = reader.ReadDefiniteLengthTextStringBytes(); string result = Encoding.UTF8.GetString(resultBytes.Span -#if !NETCOREAPP +#if !NET .ToArray() #endif ); diff --git a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/NonCryptographicHashAlgorithm.cs b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/NonCryptographicHashAlgorithm.cs index c11622efbbd2f1..9b18216370a11f 100644 --- a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/NonCryptographicHashAlgorithm.cs +++ b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/NonCryptographicHashAlgorithm.cs @@ -156,7 +156,7 @@ private async Task AppendAsyncCore(Stream stream, CancellationToken cancellation while (true) { -#if NETCOREAPP +#if NET int read = await stream.ReadAsync(buffer.AsMemory(), cancellationToken).ConfigureAwait(false); #else int read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false); diff --git a/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs b/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs index fe17c4c14eab87..3204d93d4fb577 100644 --- a/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs +++ b/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs @@ -334,7 +334,7 @@ protected TestCaseBase(string name, byte[] output) internal static string ToHexString(ReadOnlySpan input) { -#if NETCOREAPP +#if NET return Convert.ToHexString(input); #else var builder = new global::System.Text.StringBuilder(input.Length * 2); @@ -350,7 +350,7 @@ internal static string ToHexString(ReadOnlySpan input) internal static byte[] FromHexString(string hexString) { -#if NETCOREAPP +#if NET return Convert.FromHexString(hexString); #else byte[] bytes = new byte[hexString.Length / 2]; diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipWrappingStream.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipWrappingStream.cs index e3f3b42e775310..2a50857af0e3f2 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipWrappingStream.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipWrappingStream.cs @@ -67,7 +67,7 @@ int count return _baseStream.Read(buffer, offset, count); } -#if NETCOREAPP +#if NET public override void Write( ReadOnlySpan buffer ) diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeReader.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeReader.cs index 747d23e778f87a..0b4d13593a03f6 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeReader.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeReader.cs @@ -171,7 +171,7 @@ public override void Complete(Exception? exception = null) } } -#if NETCOREAPP +#if NET public override ValueTask CompleteAsync(Exception? exception = null) => CompleteAndGetNeedsDispose() ? InnerStream.DisposeAsync() : default; #endif @@ -239,7 +239,7 @@ private ValueTask ReadInternalAsync(int? minimumSize, CancellationTo return Core(this, minimumSize, tokenSource, cancellationToken); -#if NETCOREAPP +#if NET [AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<>))] #endif static async ValueTask Core(StreamPipeReader reader, int? minimumSize, CancellationTokenSource tokenSource, CancellationToken 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 c065df5cd1a10b..6f5731a9fbb07f 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 @@ -286,7 +286,7 @@ private void Cancel() InternalTokenSource.Cancel(); } -#if NETCOREAPP +#if NET [AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<>))] #endif private async ValueTask FlushAsyncInternal(bool writeToStream, ReadOnlyMemory data, CancellationToken cancellationToken = default) diff --git a/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledReadsStream.cs b/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledReadsStream.cs index 0b925b337a7482..dc6c6474f1fcd4 100644 --- a/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledReadsStream.cs +++ b/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledReadsStream.cs @@ -24,7 +24,7 @@ public override async Task ReadAsync(byte[] buffer, int offset, int count, return 0; } -#if NETCOREAPP +#if NET 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 a0e15629cee1d6..a3bde09cad0a27 100644 --- a/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledWritesStream.cs +++ b/src/libraries/System.IO.Pipelines/tests/Infrastructure/CancelledWritesStream.cs @@ -23,7 +23,7 @@ public override async Task WriteAsync(byte[] buffer, int offset, int count, Canc cancellationToken.ThrowIfCancellationRequested(); } -#if NETCOREAPP +#if NET 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 b46d0c233ea37a..72640a70e4f730 100644 --- a/src/libraries/System.IO.Pipelines/tests/Infrastructure/ThrowAfterNWritesStream.cs +++ b/src/libraries/System.IO.Pipelines/tests/Infrastructure/ThrowAfterNWritesStream.cs @@ -32,7 +32,7 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati return Task.CompletedTask; } -#if NETCOREAPP +#if NET 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 f70373c58fefd3..f9fb1f87dbafba 100644 --- a/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs @@ -614,7 +614,7 @@ public async Task CompleteCallsAppropriateDisposeMethodOnUnderlyingStream() stream = new(); reader = PipeReader.Create(stream); await reader.CompleteAsync(); -#if NETCOREAPP +#if NET Assert.False(stream.DisposeCalled); Assert.True(stream.DisposeAsyncCalled); #else @@ -661,7 +661,7 @@ public override Task ReadAsync(byte[] buffer, int offset, int count, Cancel { throw new OperationCanceledException(); } -#if NETCOREAPP +#if NET public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) { throw new OperationCanceledException(); @@ -696,7 +696,7 @@ public override async Task ReadAsync(byte[] buffer, int offset, int count, return bytes; } -#if NETCOREAPP +#if NET public override async ValueTask ReadAsync(Memory destination, CancellationToken cancellationToken = default) { if (_throwOnNextCallToRead) @@ -723,7 +723,7 @@ protected override void Dispose(bool disposing) DisposeCalled = true; } -#if NETCOREAPP +#if NET public override ValueTask DisposeAsync() { DisposeAsyncCalled = true; diff --git a/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs b/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs index 6b158f8fdb2256..3a812857822df6 100644 --- a/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs @@ -661,7 +661,7 @@ public override Task FlushAsync(CancellationToken cancellationToken) throw new OperationCanceledException(); } -#if NETCOREAPP +#if NET public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) { throw new OperationCanceledException(); diff --git a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.Unix.cs b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.Unix.cs index edcf919c2ea684..65bbba57685a21 100644 --- a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.Unix.cs +++ b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.Unix.cs @@ -13,7 +13,7 @@ public partial class SerialPort : Component { public static string[] GetPortNames() { -#if NETCOREAPP +#if NET return OperatingSystem.IsLinux() ? GetPortNames_Linux() : OperatingSystem.IsAndroid() ? GetPortNames_Linux() : OperatingSystem.IsMacOS() ? GetPortNames_OSX() diff --git a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs index 398eb2817a1d91..fa79f2a9c1e0ea 100644 --- a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs +++ b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs @@ -562,7 +562,7 @@ internal SerialStream(string portName, int baudRate, Parity parity, int dataBits if (!portName.StartsWith("COM", StringComparison.OrdinalIgnoreCase) || !uint.TryParse( -#if NETCOREAPP +#if NET portName.AsSpan(3), #else portName.Substring(3), diff --git a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpClientJsonExtensions.cs b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpClientJsonExtensions.cs index 2d033b206872e6..4223cf3e064109 100644 --- a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpClientJsonExtensions.cs +++ b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpClientJsonExtensions.cs @@ -95,7 +95,7 @@ public static partial class HttpClientJsonExtensions { // Matches how HttpClient throws a timeout exception. string message = SR.Format(SR.net_http_request_timedout, client.Timeout.TotalSeconds); -#if NETCOREAPP +#if NET throw new TaskCanceledException(message, new TimeoutException(oce.Message, oce), oce.CancellationToken); #else throw new TaskCanceledException(message, new TimeoutException(oce.Message, oce)); diff --git a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs index 539df6d3d43f22..179cb829ef52df 100644 --- a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs +++ b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs @@ -114,7 +114,7 @@ private Task SerializeToStreamAsyncCore(Stream targetStream, CancellationToken c private async Task SerializeToStreamAsyncTranscoding(Stream targetStream, bool async, Encoding targetEncoding, CancellationToken cancellationToken) { // Wrap provided stream into a transcoding stream that buffers the data transcoded from utf-8 to the targetEncoding. -#if NETCOREAPP +#if NET Stream transcodingStream = Encoding.CreateTranscodingStream(targetStream, targetEncoding, Encoding.UTF8, leaveOpen: true); try { diff --git a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/LengthLimitReadStream.cs b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/LengthLimitReadStream.cs index 9837587958a927..b40d400f89fb56 100644 --- a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/LengthLimitReadStream.cs +++ b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/LengthLimitReadStream.cs @@ -37,7 +37,7 @@ internal static void ThrowExceededBufferLimit(int limit) public override bool CanSeek => _innerStream.CanSeek; public override bool CanWrite => false; -#if NETCOREAPP +#if NET public override Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => ReadAsync(new Memory(buffer, offset, count), cancellationToken).AsTask(); diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs index fee02cc8822950..a57b1cf24f5162 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs @@ -478,7 +478,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => Exception ex = await Assert.ThrowsAsync(() => useDeleteAsync ? client.DeleteFromJsonAsync(uri) : client.GetFromJsonAsync(uri)); -#if NETCOREAPP +#if NET Assert.Contains("HttpClient.Timeout", ex.Message); Assert.IsType(ex.InnerException); #endif @@ -526,7 +526,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => } }); -#if NETCOREAPP +#if NET Assert.Contains("HttpClient.Timeout", ex.Message); Assert.IsType(ex.InnerException); #endif diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/NoWriteNoSeekStreamContent.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/NoWriteNoSeekStreamContent.cs index 047ef52edbb562..67992f6b25c4b2 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/NoWriteNoSeekStreamContent.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/NoWriteNoSeekStreamContent.cs @@ -29,7 +29,7 @@ protected override Task SerializeToStreamAsync(Stream stream, TransportContext? SerializeToStreamAsync(stream, context, CancellationToken.None); #pragma warning disable IDE0060 -#if NETCOREAPP +#if NET protected override #else internal diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseStream.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseStream.cs index dccbaea01da0b5..5482588aa2f5e6 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseStream.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseStream.cs @@ -154,7 +154,7 @@ private async Task CopyToAsyncCore(Stream destination, byte[] buffer, Cancellati Debug.Assert(bytesRead > 0); // Write that data out to the output stream -#if NETSTANDARD2_1 || NETCOREAPP +#if NETSTANDARD2_1 || NET await destination.WriteAsync(buffer.AsMemory(0, bytesRead), cancellationToken).ConfigureAwait(false); #else await destination.WriteAsync(buffer, 0, bytesRead, cancellationToken).ConfigureAwait(false); diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpTrailersHelper.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpTrailersHelper.cs index 2bf4de4e34eb37..e4f4257a366feb 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpTrailersHelper.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpTrailersHelper.cs @@ -11,7 +11,7 @@ namespace System.Net.Http internal static class WinHttpTrailersHelper { // UNITTEST is true when building against WinHttpHandler.Unit.Tests, which includes the source file. -#if !NETSTANDARD2_1 && !NETCOREAPP && !UNITTEST +#if !NETSTANDARD2_1 && !NET && !UNITTEST // Trailer property name was chosen to be descriptive and be unlikely to collide with a user set property. // Apps and libraries will use this key so it shouldn't change. private const string RequestMessagePropertyName = "__ResponseTrailers"; @@ -24,7 +24,7 @@ private sealed class HttpResponseTrailers : HttpHeaders public static HttpHeaders GetResponseTrailers(HttpResponseMessage response) { -#if NETSTANDARD2_1 || NETCOREAPP || UNITTEST +#if NETSTANDARD2_1 || NET || UNITTEST return response.TrailingHeaders; #else HttpResponseTrailers responseTrailers = new HttpResponseTrailers(); diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/PlatformHandlerTest.cs b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/PlatformHandlerTest.cs index b75571770fa9ec..0d2165eda36e91 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/PlatformHandlerTest.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/PlatformHandlerTest.cs @@ -82,7 +82,7 @@ public sealed class PlatformHandler_HttpClientEKUTest : HttpClientEKUTest public PlatformHandler_HttpClientEKUTest(ITestOutputHelper output) : base(output) { } } -#if NETCOREAPP +#if NET public sealed class PlatformHandler_HttpClientHandler_Decompression_Tests : HttpClientHandler_Decompression_Test { public PlatformHandler_HttpClientHandler_Decompression_Tests(ITestOutputHelper output) : base(output) { } @@ -182,7 +182,7 @@ public sealed class PlatformHandler_HttpClientHandler_Authentication_Test : Http public PlatformHandler_HttpClientHandler_Authentication_Test(ITestOutputHelper output) : base(output) { } } -#if NETCOREAPP +#if NET #if !WINHTTPHANDLER_TEST // [ActiveIssue("https://github.com/dotnet/runtime/issues/33930")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows10Version1607OrGreater))] public sealed class PlatformHandlerTest_Cookies_Http2 : HttpClientHandlerTest_Cookies diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.RequestRetry.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.RequestRetry.cs index 4e2426b958e658..8198fb8818a08e 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.RequestRetry.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.RequestRetry.cs @@ -170,7 +170,7 @@ public SynchronizedSendContent(TaskCompletionSource sendingContent, Task c _sendingContent = sendingContent; } -#if NETCOREAPP +#if NET protected override void SerializeToStream(Stream stream, TransportContext context, CancellationToken cancellationToken) => SerializeToStreamAsync(stream, context).GetAwaiter().GetResult(); #endif diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.SocketsHttpHandler.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.SocketsHttpHandler.cs index 888b38b813127e..088e57294d54b2 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.SocketsHttpHandler.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.SocketsHttpHandler.cs @@ -96,7 +96,7 @@ protected static LoopbackServerFactory GetFactoryForVersion(Version useVersion) { return useVersion.Major switch { -#if NETCOREAPP +#if NET #if HTTP3 3 => Http3LoopbackServerFactory.Singleton, #endif diff --git a/src/libraries/System.Numerics.Tensors/tests/Helpers.cs b/src/libraries/System.Numerics.Tensors/tests/Helpers.cs index 1cc399d0a5a52c..a43f770bd16bd4 100644 --- a/src/libraries/System.Numerics.Tensors/tests/Helpers.cs +++ b/src/libraries/System.Numerics.Tensors/tests/Helpers.cs @@ -20,7 +20,7 @@ internal static class Helpers public const float DefaultHalfTolerance = 3.90625e-03f; public const double DefaultToleranceForEstimates = 1.171875e-02; -#if NETCOREAPP +#if NET private static class DefaultTolerance where T : unmanaged, INumber { public static readonly T Value = DetermineTolerance(DefaultDoubleTolerance, DefaultFloatTolerance, Half.CreateTruncating(DefaultHalfTolerance)) ?? T.CreateTruncating(0); @@ -54,7 +54,7 @@ public static bool IsEqualWithTolerance(float expected, float actual, float? tol public static T? DetermineTolerance( double? doubleTolerance = null, float? floatTolerance = null -#if NETCOREAPP +#if NET , Half? halfTolerance = null #endif ) where T : struct @@ -67,7 +67,7 @@ public static bool IsEqualWithTolerance(float expected, float actual, float? tol { return (T?)(object)floatTolerance; } -#if NETCOREAPP +#if NET else if (typeof(T) == typeof(Half) && halfTolerance != null) { return (T?)(object)halfTolerance; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Delegation/DelegatingAssembly.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Delegation/DelegatingAssembly.cs index dd48ebd0d9e00f..c2588f7fde3314 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Delegation/DelegatingAssembly.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Delegation/DelegatingAssembly.cs @@ -72,7 +72,7 @@ public override SecurityRuleSet SecurityRuleSet get { return UnderlyingAssembly.SecurityRuleSet; } } -#if NETCOREAPP +#if NET [Obsolete] [RequiresAssemblyFiles] #endif @@ -91,7 +91,7 @@ public override MethodInfo? EntryPoint get { return UnderlyingAssembly.EntryPoint; } } -#if NETCOREAPP +#if NET [Obsolete] [RequiresAssemblyFiles] #endif @@ -200,7 +200,7 @@ public override Type[] GetTypes() return UnderlyingAssembly.GetTypes(); } -#if NETCOREAPP +#if NET [Obsolete] #endif public override bool GlobalAssemblyCache diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Delegation/DelegatingModule.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Delegation/DelegatingModule.cs index d69e26494a779c..21e19635db409f 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Delegation/DelegatingModule.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Delegation/DelegatingModule.cs @@ -25,7 +25,7 @@ public override Assembly Assembly internal const string UnknownStringMessageInRAF = "Returns for modules with no file path"; -#if NETCOREAPP +#if NET [RequiresAssemblyFiles(UnknownStringMessageInRAF)] #endif public override string FullyQualifiedName @@ -48,7 +48,7 @@ public override Guid ModuleVersionId get { return UnderlyingModule.ModuleVersionId; } } -#if NETCOREAPP +#if NET [RequiresAssemblyFiles(UnknownStringMessageInRAF)] #endif public override string Name diff --git a/src/libraries/System.Reflection.DispatchProxy/tests/DispatchProxyTests.cs b/src/libraries/System.Reflection.DispatchProxy/tests/DispatchProxyTests.cs index 96091763187549..df16833b724e29 100644 --- a/src/libraries/System.Reflection.DispatchProxy/tests/DispatchProxyTests.cs +++ b/src/libraries/System.Reflection.DispatchProxy/tests/DispatchProxyTests.cs @@ -557,7 +557,7 @@ public static void Proxy_Declares_Interface_Properties(bool useGenericCreate) Assert.NotNull(propertyInfo); } -#if NETCOREAPP +#if NET [Fact] public static void Invoke_Event_Add_And_Remove_And_Raise_Invokes_Correct_Methods_Generic_And_Non_Generic_Tests() { diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BitArithmetic.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BitArithmetic.cs index 7ad3c4aba6e618..43e7f2aad0f6e5 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BitArithmetic.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BitArithmetic.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; -#if NETCOREAPP +#if NET using System.Numerics; #endif @@ -17,7 +17,7 @@ internal static int CountBits(int v) internal static int CountBits(uint v) { -#if NETCOREAPP +#if NET return BitOperations.PopCount(v); #else unchecked @@ -31,7 +31,7 @@ internal static int CountBits(uint v) internal static int CountBits(ulong v) { -#if NETCOREAPP +#if NET return BitOperations.PopCount(v); #else const ulong Mask01010101 = 0x5555555555555555UL; diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BlobUtilities.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BlobUtilities.cs index 843e95e616d34b..462d2408b1d3e1 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BlobUtilities.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BlobUtilities.cs @@ -20,7 +20,7 @@ public static void WriteBytes(this byte[] buffer, int start, byte value, int byt public static void WriteDouble(this byte[] buffer, int start, double value) { -#if NETCOREAPP +#if NET WriteUInt64(buffer, start, BitConverter.DoubleToUInt64Bits(value)); #else WriteUInt64(buffer, start, *(ulong*)&value); @@ -29,7 +29,7 @@ public static void WriteDouble(this byte[] buffer, int start, double value) public static void WriteSingle(this byte[] buffer, int start, float value) { -#if NETCOREAPP +#if NET WriteUInt32(buffer, start, BitConverter.SingleToUInt32Bits(value)); #else WriteUInt32(buffer, start, *(uint*)&value); @@ -76,7 +76,7 @@ public static void WriteDecimal(this byte[] buffer, int start, decimal value) public static void WriteGuid(this byte[] buffer, int start, Guid value) { -#if NETCOREAPP +#if NET bool written = value.TryWriteBytes(buffer.AsSpan(start)); // This function is not public, callers have to ensure that enough space is available. Debug.Assert(written); diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/DecimalUtilities.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/DecimalUtilities.cs index 3733a4b45a5a0e..be69480203e924 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/DecimalUtilities.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/DecimalUtilities.cs @@ -7,7 +7,7 @@ internal static class DecimalUtilities { public static int GetScale(this decimal value) { -#if NETCOREAPP +#if NET Span bits = stackalloc int[4]; decimal.GetBits(value, bits); return unchecked((byte)(bits[3] >> 16)); @@ -18,7 +18,7 @@ public static int GetScale(this decimal value) public static void GetBits(this decimal value, out bool isNegative, out byte scale, out uint low, out uint mid, out uint high) { -#if NETCOREAPP +#if NET Span bits = stackalloc int[4]; decimal.GetBits(value, bits); #else diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ImmutableMemoryStream.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ImmutableMemoryStream.cs index 26dc9290ab4e6f..fe94886ac859d9 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ImmutableMemoryStream.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ImmutableMemoryStream.cs @@ -72,7 +72,7 @@ public override int Read(byte[] buffer, int offset, int count) return result; } -#if NETCOREAPP +#if NET // Duplicate the Read(byte[]) logic here instead of refactoring both to use Spans // so we don't affect perf on .NET Framework. public override int Read(Span buffer) diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ReadOnlyUnmanagedMemoryStream.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ReadOnlyUnmanagedMemoryStream.cs index 2a31a96a154058..b3fe0044c43c92 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ReadOnlyUnmanagedMemoryStream.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ReadOnlyUnmanagedMemoryStream.cs @@ -36,7 +36,7 @@ public override int Read(byte[] buffer, int offset, int count) return bytesRead; } -#if NETCOREAPP +#if NET // Duplicate the Read(byte[]) logic here instead of refactoring both to use Spans // so we don't affect perf on .NET Framework. public override int Read(Span buffer) diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/StreamExtensions.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/StreamExtensions.cs index 2bda7989a9bb9b..484f138762fe41 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/StreamExtensions.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/StreamExtensions.cs @@ -76,7 +76,7 @@ internal static int TryReadAll(this Stream stream, byte[] buffer, int offset, in return totalBytesRead; } -#if NETCOREAPP +#if NET internal static int TryReadAll(this Stream stream, Span buffer) #if NET => stream.ReadAtLeast(buffer, buffer.Length, throwOnEndOfStream: false); diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.EmbeddedPortablePdb.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.EmbeddedPortablePdb.cs index 51eff57e43c03f..e9d3b25e95af50 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.EmbeddedPortablePdb.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.EmbeddedPortablePdb.cs @@ -99,7 +99,7 @@ internal static unsafe NativeHeapMemoryBlock DecodeEmbeddedPortablePdbDebugDirec try { -#if NETCOREAPP +#if NET actualLength = deflate.TryReadAll(new Span(decompressed.Pointer, decompressed.Size)); #else using var decompressedStream = new UnmanagedMemoryStream(decompressed.Pointer, decompressed.Size, decompressed.Size, FileAccess.Write); diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs index 62944bef46d208..b697f7fadab38d 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs @@ -197,7 +197,7 @@ public void TestCustomAttributeDecoderUsingReflection() } } -#if NETCOREAPP && !TARGET_BROWSER // Generic attribute is not supported on .NET Framework. +#if NET && !TARGET_BROWSER // Generic attribute is not supported on .NET Framework. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS)] public void TestCustomAttributeDecoderGenericUsingReflection() diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/TypeNameTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/TypeNameTests.cs index 53f8e43821bc61..a5e22b5d6c503b 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/TypeNameTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/TypeNameTests.cs @@ -81,7 +81,7 @@ public void ParserIsNotEnforcingRuntimeSpecificRules(string input) if (PlatformDetection.IsNotMonoRuntime) // https://github.com/dotnet/runtime/issues/45033 { -#if NETCOREAPP +#if NET Assert.Throws(() => Type.GetType(input)); #endif } @@ -631,7 +631,7 @@ static void Test(Type type) Assert.Equal(type.AssemblyQualifiedName, parsed.AssemblyQualifiedName); // now load load the type from name Verify(type, parsed, ignoreCase: false); -#if NETCOREAPP // something weird is going on here +#if NET // something weird is going on here // load using lowercase name Verify(type, TypeName.Parse(type.AssemblyQualifiedName.ToLower().AsSpan()), ignoreCase: true); // load using uppercase name diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.Modules.cs b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.Modules.cs index b6ad1c372e0f78..e5caf0e3a79f89 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.Modules.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.Modules.cs @@ -17,7 +17,7 @@ internal abstract partial class RoAssembly public sealed override Module? GetModule(string name) => GetRoModule(name); public sealed override Module[] GetModules(bool getResourceModules) => ComputeRoModules(getResourceModules).CloneArray(); -#if NETCOREAPP +#if NET [RequiresAssemblyFiles(ThrowingMessageInRAF)] #endif public sealed override FileStream? GetFile(string name) @@ -28,7 +28,7 @@ internal abstract partial class RoAssembly return new FileStream(m.FullyQualifiedName, FileMode.Open, FileAccess.Read, FileShare.Read); } -#if NETCOREAPP +#if NET [RequiresAssemblyFiles(ThrowingMessageInRAF)] #endif public sealed override FileStream[] GetFiles(bool getResourceModules) diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.cs b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.cs index 9e0e4320a021c9..8ba5c16560087e 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.cs @@ -45,12 +45,12 @@ protected RoAssembly(MetadataLoadContext loader, int assemblyFileCount) // Location and codebase public abstract override string Location { get; } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeBaseMessage, DiagnosticId = Obsoletions.CodeBaseDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] [RequiresAssemblyFiles(ThrowingMessageInRAF)] #endif public sealed override string CodeBase => throw new NotSupportedException(SR.NotSupported_AssemblyCodeBase); -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeBaseMessage, DiagnosticId = Obsoletions.CodeBaseDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] [RequiresAssemblyFiles(ThrowingMessageInRAF)] #endif @@ -159,7 +159,7 @@ public sealed override AssemblyName[] GetReferencedAssemblies() // Miscellaneous properties public sealed override bool ReflectionOnly => true; -#if NETCOREAPP +#if NET [Obsolete("The Global Assembly Cache is not supported.", DiagnosticId = "SYSLIB0005", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed override bool GlobalAssemblyCache => false; diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Helpers.cs b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Helpers.cs index cc8e5f3ce1ad23..c303886f9e7063 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Helpers.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Helpers.cs @@ -367,7 +367,7 @@ public static RoAssemblyName ToRoAssemblyName(this AssemblyName assemblyName) public static byte[] ToUtf8(this string s) => Encoding.UTF8.GetBytes(s); -#if NETCOREAPP +#if NET public static string ToUtf16(this ReadOnlySpan utf8) => Encoding.UTF8.GetString(utf8); #else public static unsafe string ToUtf16(this ReadOnlySpan utf8) diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Modules/RoModule.cs b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Modules/RoModule.cs index bd19faaac6256d..f236b209b3d25f 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Modules/RoModule.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Modules/RoModule.cs @@ -34,7 +34,7 @@ internal RoModule(string fullyQualifiedName) internal const string UnknownStringMessageInRAF = "Returns for modules with no file path"; -#if NETCOREAPP +#if NET [RequiresAssemblyFiles(UnknownStringMessageInRAF)] #endif public sealed override string FullyQualifiedName => _fullyQualifiedName; @@ -42,7 +42,7 @@ internal RoModule(string fullyQualifiedName) public abstract override int MetadataToken { get; } public abstract override Guid ModuleVersionId { get; } -#if NETCOREAPP +#if NET [RequiresAssemblyFiles(UnknownStringMessageInRAF)] #endif public sealed override string Name diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/RoModifiedType.cs b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/RoModifiedType.cs index afb9c79952ccfe..0e5928d26bbc6c 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/RoModifiedType.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/RoModifiedType.cs @@ -152,7 +152,7 @@ public override Type[] GetOptionalCustomModifiers() public override IEnumerable DeclaredNestedTypes { -#if NETCOREAPP +#if NET [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicNestedTypes)] #endif get { throw new NotSupportedException(SR.NotSupported_ModifiedType); } 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 95ae7cea3e3e1c..e4fb5fbc1f5ac8 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/NetStandardBridge.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/NetStandardBridge.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Tests { internal static class NetCoreApiEmulators { -#if NETCOREAPP +#if NET 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.Runtime.Caching/src/System/Runtime/Caching/Configuration/CachingSectionGroup.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/CachingSectionGroup.cs index 327dd53ba40735..2a72776e992089 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/CachingSectionGroup.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/CachingSectionGroup.cs @@ -7,7 +7,7 @@ namespace System.Runtime.Caching.Configuration { -#if NETCOREAPP +#if NET [UnsupportedOSPlatform("browser")] #endif internal sealed class CachingSectionGroup : ConfigurationSectionGroup diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheElement.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheElement.cs index 9fcfd59126aa40..a72fc237c5f055 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheElement.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheElement.cs @@ -8,7 +8,7 @@ namespace System.Runtime.Caching.Configuration { -#if NETCOREAPP +#if NET [UnsupportedOSPlatform("browser")] #endif internal sealed class MemoryCacheElement : ConfigurationElement diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSection.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSection.cs index 05e0387374ec8d..cd15eaa788b61e 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSection.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSection.cs @@ -21,7 +21,7 @@ namespace System.Runtime.Caching.Configuration */ -#if NETCOREAPP +#if NET [UnsupportedOSPlatform("browser")] #endif internal sealed class MemoryCacheSection : ConfigurationSection diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSettingsCollection.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSettingsCollection.cs index e3c1a5bd3eb1da..8088d208640d34 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSettingsCollection.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSettingsCollection.cs @@ -7,7 +7,7 @@ namespace System.Runtime.Caching.Configuration { -#if NETCOREAPP +#if NET [UnsupportedOSPlatform("browser")] #endif [ConfigurationCollection(typeof(MemoryCacheElement), diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Counters.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Counters.cs index bd5e9d11eea649..8e8d65117bf950 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Counters.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Counters.cs @@ -9,12 +9,12 @@ namespace System.Runtime.Caching { -#if NETCOREAPP +#if NET [UnsupportedOSPlatform("browser")] #endif internal sealed class Counters : EventSource { -#if NETCOREAPP +#if NET private const string EVENT_SOURCE_NAME_ROOT = "System.Runtime.Caching."; private const int NUM_COUNTERS = 7; diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs index 76a6eabd0088a2..ee23f09a97e150 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs @@ -11,7 +11,7 @@ namespace System.Runtime.Caching { -#if NETCOREAPP +#if NET [UnsupportedOSPlatform("browser")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/HostFileChangeMonitor.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/HostFileChangeMonitor.cs index fa5afafe378738..374ff288ea0bbe 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/HostFileChangeMonitor.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/HostFileChangeMonitor.cs @@ -98,7 +98,7 @@ private static void InitFCN() #pragma warning disable IDE0074 // Use compound assignment if (fcn == null) { -#if NETCOREAPP +#if NET if (OperatingSystem.IsBrowser() || (OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS()) { throw new PlatformNotSupportedException(); diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs index 18a0cad6bce880..75053fdbbe52df 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs @@ -40,7 +40,7 @@ public class MemoryCache : ObjectCache, IEnumerable, IDisposable private bool _throwOnDisposed; private EventHandler _onAppDomainUnload; private UnhandledExceptionEventHandler _onUnhandledException; -#if NETCOREAPP +#if NET [UnsupportedOSPlatformGuard("browser")] private static bool _countersSupported => !OperatingSystem.IsBrowser(); #else diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStatistics.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStatistics.cs index 96cfc3bda655bd..dba747c4acdfe5 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStatistics.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStatistics.cs @@ -37,7 +37,7 @@ internal sealed class MemoryCacheStatistics : IDisposable private CacheMemoryMonitor _cacheMemoryMonitor; private readonly MemoryCache _memoryCache; private readonly PhysicalMemoryMonitor _physicalMemoryMonitor; -#if NETCOREAPP +#if NET [UnsupportedOSPlatformGuard("browser")] private static bool _configSupported => !OperatingSystem.IsBrowser(); #else @@ -153,7 +153,7 @@ private void InitializeConfiguration(NameValueCollection config) _configCacheMemoryLimitMegabytes = ConfigUtil.GetIntValue(config, ConfigUtil.CacheMemoryLimitMegabytes, _configCacheMemoryLimitMegabytes, true, int.MaxValue); _configPhysicalMemoryLimitPercentage = ConfigUtil.GetIntValue(config, ConfigUtil.PhysicalMemoryLimitPercentage, _configPhysicalMemoryLimitPercentage, true, 100); } -#if !NETCOREAPP +#if !NET if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && _configPhysicalMemoryLimitPercentage > 0) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_PhysicalMemoryLimitPercentage); diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStore.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStore.cs index 1381b7043dd844..146935b54bafa0 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStore.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStore.cs @@ -26,7 +26,7 @@ internal sealed class MemoryCacheStore : IDisposable private volatile bool _useInsertBlock; private readonly MemoryCache _cache; private readonly Counters _perfCounters; -#if NETCOREAPP +#if NET [UnsupportedOSPlatformGuard("browser")] private static bool _countersSupported => !OperatingSystem.IsBrowser(); #else diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/PhysicalMemoryMonitor.Unix.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/PhysicalMemoryMonitor.Unix.cs index 9629e440067137..5390e89ee5ad21 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/PhysicalMemoryMonitor.Unix.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/PhysicalMemoryMonitor.Unix.cs @@ -22,7 +22,7 @@ internal sealed partial class PhysicalMemoryMonitor : MemoryMonitor * highlights how our behavior might be slightly different from windows in these * cases since this was a monitor that cared about actual physical memory. */ -#if NETCOREAPP +#if NET private int lastGCCount; protected override int GetCurrentPressure() diff --git a/src/libraries/System.Runtime.Caching/tests/System.Runtime.Caching/CountersTest.cs b/src/libraries/System.Runtime.Caching/tests/System.Runtime.Caching/CountersTest.cs index 3fea8fb0cf28f9..9fa077c5be3809 100644 --- a/src/libraries/System.Runtime.Caching/tests/System.Runtime.Caching/CountersTest.cs +++ b/src/libraries/System.Runtime.Caching/tests/System.Runtime.Caching/CountersTest.cs @@ -73,7 +73,7 @@ private async Task PollCounters(string cacheName) { MemoryCacheCounterValues counters = new MemoryCacheCounterValues(); -#if NETCOREAPP +#if NET var events = new ConcurrentQueue(); using (var listener = new TestEventListener("System.Runtime.Caching." + cacheName, EventLevel.Verbose, eventCounterInterval: 0.1d)) { @@ -134,7 +134,7 @@ private async Task PollCounters(string cacheName) return counters; } -#if NETCOREAPP +#if NET private static async Task WaitForEventCountersAsync(ConcurrentQueue events) { DateTime startTime = DateTime.UtcNow; diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/StringMarshalingTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/StringMarshalingTests.cs index 413809f30f6007..6181069f6bf48d 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/StringMarshalingTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/StringMarshalingTests.cs @@ -147,7 +147,7 @@ public void StringToHGlobalUniToString() } -#if NETCOREAPP +#if NET [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 f599a02df8df0f..d3e06e69b43926 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTestData.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTestData.cs @@ -60,7 +60,7 @@ using System.Diagnostics.Eventing.Reader; // System.Text.Json is a .NET Core 3.0 specific library -#if NETCOREAPP +#if NET using System.Text.Json; #endif @@ -494,7 +494,7 @@ public static IEnumerable SerializableObjects() yield return new object[] { PopulateException(isolatedStorageException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netcoreapp20), new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) } }; } -#if NETCOREAPP +#if NET 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) } }; @@ -677,7 +677,7 @@ public static IEnumerable SerializableObjects() 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 NET 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 e6d9652007e396..cbb1b2bba6b2ad 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/EqualityExtensions.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/EqualityExtensions.cs @@ -23,7 +23,7 @@ using Xunit; // System.Text.Json is a .NET Core 3.0 specific library -#if NETCOREAPP +#if NET using System.Text.Json; #endif @@ -1195,7 +1195,7 @@ public static void IsEqual(this AggregateException @this, AggregateException oth @this.InnerExceptions.CheckSequenceEquals(other.InnerExceptions, isSamePlatform); } -#if NETCOREAPP +#if NET public static void IsEqual(this JsonException @this, JsonException other, bool isSamePlatform) { if (@this == null && other == null) diff --git a/src/libraries/System.Runtime/tests/System.Resources.ResourceManager.Tests/ResourceManagerTests.cs b/src/libraries/System.Runtime/tests/System.Resources.ResourceManager.Tests/ResourceManagerTests.cs index 6bb68cb65b1455..b80b709fd171fe 100644 --- a/src/libraries/System.Runtime/tests/System.Resources.ResourceManager.Tests/ResourceManagerTests.cs +++ b/src/libraries/System.Runtime/tests/System.Resources.ResourceManager.Tests/ResourceManagerTests.cs @@ -112,7 +112,7 @@ public static void GetString_FromTestClassWithoutNeutralResources() static int ResourcesAfAZEvents = 0; -#if NETCOREAPP +#if NET static System.Reflection.Assembly AssemblyResolvingEventHandler(System.Runtime.Loader.AssemblyLoadContext alc, System.Reflection.AssemblyName name) { if (name.FullName.StartsWith("System.Resources.ResourceManager.Tests.resources")) @@ -138,7 +138,7 @@ static System.Reflection.Assembly AssemblyResolveEventHandler(object sender, Res { if (name.Contains("Culture=af-ZA")) { -#if NETCOREAPP +#if NET Assert.Equal(1, ResourcesAfAZEvents); #else Assert.Equal(0, ResourcesAfAZEvents); @@ -162,7 +162,7 @@ public static void GetString_ExpectEvents() private static void Remote_ExpectEvents() { -#if NETCOREAPP +#if NET System.Runtime.Loader.AssemblyLoadContext.Default.Resolving += AssemblyResolvingEventHandler; #endif AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(AssemblyResolveEventHandler); @@ -176,7 +176,7 @@ private static void Remote_ExpectEvents() string actual = resourceManager.GetString("One", culture); Assert.Equal("Value-One", actual); -#if NETCOREAPP +#if NET Assert.Equal(2, ResourcesAfAZEvents); #else Assert.Equal(1, ResourcesAfAZEvents); diff --git a/src/libraries/System.Runtime/tests/System.ValueTuple.Tests/ValueTupleTests.cs b/src/libraries/System.Runtime/tests/System.ValueTuple.Tests/ValueTupleTests.cs index 147b4ea9647cbf..0e85e1565149db 100644 --- a/src/libraries/System.Runtime/tests/System.ValueTuple.Tests/ValueTupleTests.cs +++ b/src/libraries/System.Runtime/tests/System.ValueTuple.Tests/ValueTupleTests.cs @@ -3,7 +3,7 @@ using System.Collections; using Xunit; -#if NETCOREAPP +#if NET using System.Runtime.CompilerServices; #endif @@ -775,7 +775,7 @@ public static void ZeroTuples() 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 NET ITuple it = ValueTuple.Create(); Assert.Throws(() => it[-1].ToString()); Assert.Throws(() => it[0].ToString()); @@ -812,7 +812,7 @@ public static void OneTuples() Assert.Equal("()", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if NETCOREAPP +#if NET ITuple it = ValueTuple.Create(1); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -852,7 +852,7 @@ public static void TwoTuples() Assert.Equal("(, )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if NETCOREAPP +#if NET ITuple it = ValueTuple.Create(1, 2); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -897,7 +897,7 @@ public static void ThreeTuples() Assert.Equal("(, , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if NETCOREAPP +#if NET ITuple it = ValueTuple.Create(1, 2, 3); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -948,7 +948,7 @@ public static void FourTuples() Assert.Equal("(, , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if NETCOREAPP +#if NET ITuple it = ValueTuple.Create(1, 2, 3, 4); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -1004,7 +1004,7 @@ public static void FiveTuples() Assert.Equal("(, , , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if NETCOREAPP +#if NET ITuple it = ValueTuple.Create(1, 2, 3, 4, 5); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -1065,7 +1065,7 @@ public static void SixTuples() Assert.Equal("(, , , , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if NETCOREAPP +#if NET ITuple it = ValueTuple.Create(1, 2, 3, 4, 5, 6); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -1131,7 +1131,7 @@ public static void SevenTuples() Assert.Equal("(, , , , , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if NETCOREAPP +#if NET ITuple it = ValueTuple.Create(1, 2, 3, 4, 5, 6, 7); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -1223,7 +1223,7 @@ public static void EightTuples() Assert.Equal("(, , , , , , , )", vtWithNull.ToString()); Assert.Equal(tupleWithNull.ToString(), vtWithNull.ToString()); -#if NETCOREAPP +#if NET ITuple it = CreateLong(1, 2, 3, 4, 5, 6, 7, ValueTuple.Create(8)); Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); @@ -1312,7 +1312,7 @@ public static void EightTuplesWithBadRest() 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 NET ITuple it = d; Assert.Throws(() => it[-1].ToString()); Assert.Equal(1, it[0]); diff --git a/src/libraries/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSignature.cs b/src/libraries/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSignature.cs index 831c5c8f676bd2..da0962a48b3bdf 100644 --- a/src/libraries/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSignature.cs +++ b/src/libraries/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSignature.cs @@ -450,7 +450,7 @@ private bool VerifyCore(AsymmetricAlgorithm key, ReadOnlySpan contentBytes private bool VerifyHash(AsymmetricAlgorithm key, IncrementalHash hasher, HashAlgorithmName hashAlgorithm, KeyType keyType, RSASignaturePadding? padding) { -#if NETCOREAPP +#if NET Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). Span hash = stackalloc byte[hasher.HashLengthInBytes]; hasher.GetHashAndReset(hash); diff --git a/src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs b/src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs index 4eb5d7dba72dd5..2e73ce54ffefbd 100644 --- a/src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs +++ b/src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs @@ -588,7 +588,7 @@ public static IEnumerable AllCborTypes() w.WriteDouble(default); yield return ReturnDataAndReset(w); -#if NETCOREAPP +#if NET w.WriteHalf(default); yield return ReturnDataAndReset(w); #endif diff --git a/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.cs b/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.cs index 6c17e4ac084049..f687149f802229 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.cs @@ -83,7 +83,7 @@ public void Reset() { } public sealed partial class CmsSigner { public CmsSigner() { } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("CmsSigner(CspParameters) is obsolete and is not supported. Use an alternative constructor instead.", DiagnosticId = "SYSLIB0034", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -270,7 +270,7 @@ internal SignerInfo() { } public void CheckHash() { } public void CheckSignature(bool verifySignatureOnly) { } public void CheckSignature(System.Security.Cryptography.X509Certificates.X509Certificate2Collection extraStore, bool verifySignatureOnly) { } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("ComputeCounterSignature without specifying a CmsSigner is obsolete and is not supported. Use the overload that accepts a CmsSigner.", DiagnosticId = "SYSLIB0035", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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 e95be29e999099..fd9cc62ac0ec22 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 @@ private KeyTransRecipientInfoAsn MakeKtri( return null; } -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || 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 c0831046595a23..69525a16b001e9 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 @@ -80,7 +80,7 @@ public override byte[] GetSubjectKeyIdentifier(X509Certificate2 certificate) return (T?)(object?)certificate.GetRSAPrivateKey(); if (typeof(T) == typeof(ECDsa)) return (T?)(object?)certificate.GetECDsaPrivateKey(); -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 if (typeof(T) == typeof(DSA) && Internal.Cryptography.Helpers.IsDSASupported) return (T?)(object?)certificate.GetDSAPrivateKey(); #endif diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/PkcsPalWindows.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/PkcsPalWindows.cs index ab05ccc6f9f6ef..db93dff50c67ec 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/PkcsPalWindows.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/PkcsPalWindows.cs @@ -127,7 +127,7 @@ public sealed override byte[] GetSubjectKeyIdentifier(X509Certificate2 certifica if (keySpec == CryptKeySpec.CERT_NCRYPT_KEY_SPEC) { -#if NETSTANDARD || NETCOREAPP +#if NETSTANDARD || NET Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); #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 b26ff355f378e8..1cf3bc1f4a5a20 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 @@ -36,7 +36,7 @@ private static bool DetectInitOnlyOid() } } -#if !NETCOREAPP && !NETSTANDARD2_1 +#if !NET && !NETSTANDARD2_1 // Compatibility API. internal static void AppendData(this IncrementalHash hasher, ReadOnlySpan data) { @@ -369,7 +369,7 @@ private static string ToUpperHexString(ReadOnlySpan ba) { return Convert.ToHexString(ba); } -#elif NETCOREAPP || NETSTANDARD2_1 +#elif NETSTANDARD2_1 private static string ToUpperHexString(ReadOnlySpan ba) { return HexConverter.ToString(ba, HexConverter.Casing.Upper); @@ -433,7 +433,7 @@ public static Pkcs9AttributeObject CreateBestPkcs9AttributeObjectAvailable(Oid o Oids.SigningTime => new Pkcs9SigningTime(encodedAttribute), Oids.ContentType => new Pkcs9ContentType(encodedAttribute), Oids.MessageDigest => new Pkcs9MessageDigest(encodedAttribute), -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 Oids.LocalKeyId => new Pkcs9LocalKeyId() { RawData = encodedAttribute.ToArray() }, #endif _ => new Pkcs9AttributeObject(oid, encodedAttribute), 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 97192c83b91652..183520aa9c3f0a 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 @@ -43,7 +43,7 @@ protected override bool VerifyKeyType(AsymmetricAlgorithm key) } internal override bool VerifySignature( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -76,7 +76,7 @@ internal override bool VerifySignature( DSAParameters dsaParameters = dsa.ExportParameters(false); int bufSize = 2 * dsaParameters.Q!.Length; -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 byte[] rented = CryptoPool.Rent(bufSize); Span ieee = new Span(rented, 0, bufSize); @@ -91,7 +91,7 @@ internal override bool VerifySignature( } return dsa.VerifySignature(valueHash, ieee); -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 } finally { @@ -101,7 +101,7 @@ internal override bool VerifySignature( } protected override bool Sign( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -145,7 +145,7 @@ protected override bool Sign( signatureAlgorithm = oidValue; -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || 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 dd098e46362ea6..e89e6e5232d514 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 @@ -44,7 +44,7 @@ protected override bool VerifyKeyType(AsymmetricAlgorithm key) } internal override bool VerifySignature( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -80,7 +80,7 @@ internal override bool VerifySignature( bufSize = 2 * fieldSize; } -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 byte[] rented = CryptoPool.Rent(bufSize); Span ieee = new Span(rented, 0, bufSize); @@ -95,7 +95,7 @@ internal override bool VerifySignature( } return key.VerifyHash(valueHash, ieee); -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 } finally { @@ -105,7 +105,7 @@ internal override bool VerifySignature( } protected override bool Sign( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -152,7 +152,7 @@ protected override bool Sign( signatureAlgorithm = oidValue; -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 int bufSize; checked { @@ -188,7 +188,7 @@ protected override bool Sign( #endif signatureValue = DsaIeeeToDer(key.SignHash( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || 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 51677662dd5219..80aa6abb9085a3 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 @@ -45,7 +45,7 @@ protected override bool VerifyKeyType(AsymmetricAlgorithm key) } internal override bool VerifySignature( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -81,7 +81,7 @@ internal override bool VerifySignature( return publicKey.VerifyHash( valueHash, -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 signature.Span, #else signature, @@ -97,7 +97,7 @@ protected abstract RSASignaturePadding GetSignaturePadding( int digestValueLength); private protected static bool SignCore( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -122,7 +122,7 @@ private protected static bool SignCore( return false; } -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 byte[] signature = new byte[privateKey.KeySize / 8]; bool signed = privateKey.TrySignHash( @@ -147,7 +147,7 @@ private protected static bool SignCore( } #endif signatureValue = privateKey.SignHash( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 dataHash.ToArray(), #else dataHash, @@ -199,7 +199,7 @@ protected override RSASignaturePadding GetSignaturePadding( } protected override bool Sign( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -319,7 +319,7 @@ protected override RSASignaturePadding GetSignaturePadding( } protected override bool Sign( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || 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 7cf3436b54aa63..a0595c61dc3c00 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 @@ -30,7 +30,7 @@ static CmsSignature() protected abstract bool VerifyKeyType(AsymmetricAlgorithm key); internal abstract bool VerifySignature( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -43,7 +43,7 @@ internal abstract bool VerifySignature( X509Certificate2 certificate); protected abstract bool Sign( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -112,7 +112,7 @@ protected abstract bool Sign( } internal static bool Sign( -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || NETSTANDARD2_1 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -224,7 +224,7 @@ private static byte[] DsaIeeeToDer(ReadOnlySpan ieeeSignature) { writer.PushSequence(); -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || 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 d9d592c7d578ec..04c2fd59e78aa7 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 @@ -73,7 +73,7 @@ public CmsSigner(X509Certificate2? certificate) { } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CmsSignerCspParamsCtorMessage, DiagnosticId = Obsoletions.CmsSignerCspParamsCtorDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs index 0b0700d2658410..51dccc6458d6d2 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs @@ -96,7 +96,7 @@ public X509Certificate2Collection Certificates if (choice.Certificate.HasValue) { coll.Add(new X509Certificate2(choice.Certificate.Value -#if NETCOREAPP +#if NET .Span #else .ToArray() 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 021e1f8e9be2d4..46b6fc056e4c1b 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 @@ -262,7 +262,7 @@ private SignerInfoCollection GetCounterSigners(AttributeAsn[] unsignedAttrs) return new SignerInfoCollection(signerInfos.ToArray()); } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.SignerInfoCounterSigMessage, DiagnosticId = Obsoletions.SignerInfoCounterSigDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [EditorBrowsable(EditorBrowsableState.Never)] @@ -746,7 +746,7 @@ private bool VerifySignature( return false; } -#if NETCOREAPP || NETSTANDARD2_1 +#if NET || 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 be71f91529a105..e310abc86cd463 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/CertLoader.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/CertLoader.cs @@ -14,7 +14,7 @@ internal abstract partial class CertLoader // Prefer ephemeral when available private static X509KeyStorageFlags GetBestKeyStorageFlags() { -#if NETCOREAPP +#if NET if (OperatingSystem.IsWindows()) { // On Windows 7 ephemeral keys with a key usage embedded in the PFX @@ -176,7 +176,7 @@ public CertLoaderFromRawData(byte[] cerData, byte[] pfxData = null, string passw internal override CertLoader CloneAsEphemeralLoader() { -#if NETCOREAPP +#if NET 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 bca63841dfde72..58ff32fd632859 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTests.cs @@ -835,7 +835,7 @@ internal void VerifySimpleDecrypt(byte[] encodedMessage, CertLoader certLoader, 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 NET // 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 02b83db21688f0..288aa11e4ad94f 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/StateTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/StateTests.cs @@ -274,7 +274,7 @@ public static void PostDecode_ContentInfo_netcore() [Theory] [OuterLoop(/* Leaks key on disk if interrupted */)] [InlineData(false)] -#if NETCOREAPP // API not supported on netfx +#if NET // API not supported on netfx [InlineData(true)] #endif public static void PostDecrypt_Encode(bool useExplicitPrivateKey) @@ -300,7 +300,7 @@ public static void PostDecrypt_Encode(bool useExplicitPrivateKey) if (useExplicitPrivateKey) { -#if NETCOREAPP +#if NET ecms.Decrypt(r[0], cer.GetRSAPrivateKey()); #else Assert.Fail("Should not run on this platform"); @@ -362,7 +362,7 @@ public static void PostDecrypt_RecipientInfos() [Theory] [OuterLoop(/* Leaks key on disk if interrupted */)] [InlineData(false)] -#if NETCOREAPP // API not supported on netfx +#if NET // API not supported on netfx [InlineData(true)] #endif public static void PostDecrypt_Decrypt(bool useExplicitPrivateKey) @@ -404,7 +404,7 @@ public static void PostDecrypt_Decrypt(bool useExplicitPrivateKey) { if (useExplicitPrivateKey) { -#if NETCOREAPP +#if NET ecms.Decrypt(r[0], cert1.GetRSAPrivateKey()); #else Assert.Fail("Should not run on this platform"); diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/CertBagTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/CertBagTests.cs index 68f364b9d858ab..45ffae839acdac 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/CertBagTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/CertBagTests.cs @@ -47,7 +47,7 @@ public static void OidCtorPreservesFriendlyName() Oid firstCall = certBag.GetCertificateType(); Oid secondCall = certBag.GetCertificateType(); -#if !NETCOREAPP +#if !NET Assert.NotSame(oid, firstCall); Assert.NotSame(oid, secondCall); Assert.NotSame(firstCall, secondCall); diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/Pkcs12SafeBagTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/Pkcs12SafeBagTests.cs index d5ace8984490ac..9c7f5e360df666 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/Pkcs12SafeBagTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/Pkcs12SafeBagTests.cs @@ -66,7 +66,7 @@ public static void GetBagIdIsFactory() Assert.Equal(Oids.Aes192, firstCall.Value); Assert.Equal(firstCall.Value, secondCall.Value); -#if !NETCOREAPP +#if !NET Assert.NotSame(firstCall, secondCall); #endif } diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/CmsSignerTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/CmsSignerTests.cs index a99d2f8d4dde94..27be5cf21152f1 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/CmsSignerTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/CmsSignerTests.cs @@ -21,7 +21,7 @@ public static void SignerIdentifierType_InvalidValues(SubjectIdentifierType inva () => signer.SignerIdentifierType = invalidType); } -#if NETCOREAPP +#if NET [Fact] public static void SignaturePadding_InvalidValue() { 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 7eee42aa5db719..c0c1421daac423 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs @@ -562,7 +562,7 @@ public static void AddFirstSigner_DSA(SubjectIdentifierType identifierType, bool Assert.NotSame(cms.Certificates[0], firstSigner.Certificate); Assert.Equal(cms.Certificates[0], firstSigner.Certificate); -#if NETCOREAPP +#if NET byte[] signature = firstSigner.GetSignature(); Assert.NotEmpty(signature); // DSA PKIX signature format is a DER SEQUENCE. @@ -581,7 +581,7 @@ public static void AddFirstSigner_DSA(SubjectIdentifierType identifierType, bool Assert.Equal(identifierType, cms.SignerInfos[0].SignerIdentifier.Type); Assert.Equal(firstSigner.Certificate, cms.SignerInfos[0].Certificate); -#if NETCOREAPP +#if NET byte[] sig2 = cms.SignerInfos[0].GetSignature(); Assert.Equal(signature, sig2); #endif @@ -633,7 +633,7 @@ public static void AddFirstSigner_ECDSA(SubjectIdentifierType identifierType, bo Assert.NotSame(cms.Certificates[0], firstSigner.Certificate); Assert.Equal(cms.Certificates[0], firstSigner.Certificate); -#if NETCOREAPP +#if NET byte[] signature = firstSigner.GetSignature(); Assert.NotEmpty(signature); // ECDSA PKIX signature format is a DER SEQUENCE. @@ -655,7 +655,7 @@ public static void AddFirstSigner_ECDSA(SubjectIdentifierType identifierType, bo Assert.Equal(identifierType, cms.SignerInfos[0].SignerIdentifier.Type); Assert.Equal(firstSigner.Certificate, cms.SignerInfos[0].Certificate); -#if NETCOREAPP +#if NET byte[] sig2 = cms.SignerInfos[0].GetSignature(); Assert.Equal(signature, sig2); #endif @@ -1165,7 +1165,7 @@ public static void EnsureDataIsolation_NewDocument(bool detached) // CheckSignature doesn't read the public mutable data contentInfo.Content[0] ^= 0xFF; -#if !NETCOREAPP +#if !NET contentInfo.ContentType.Value = Oids.Pkcs7Hashed; #endif cms.CheckSignature(true); 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 8918d7adbb66c6..c5b7c000e2b733 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsWholeDocumentTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsWholeDocumentTests.cs @@ -60,7 +60,7 @@ public static void ReadRsaPssDocument(bool fromSpan) 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 NET Assert.Equal("1.2.840.113549.1.1.10", signer.SignatureAlgorithm.Value); #endif @@ -91,7 +91,7 @@ public static void ReadRsaPssDocument(bool fromSpan) messageDigestAttr.MessageDigest.ByteArrayToHex()); Assert.IsType(signedAttrs[3].Values[0]); -#if !NETCOREAPP +#if !NET Assert.NotSame(signedAttrs[3].Oid, signedAttrs[3].Values[0].Oid); #endif Assert.Equal( @@ -101,7 +101,7 @@ public static void ReadRsaPssDocument(bool fromSpan) "082A864886F70D0302020128", signedAttrs[3].Values[0].RawData.ByteArrayToHex()); -#if NETCOREAPP +#if NET Assert.Equal( "B93E81D141B3C9F159AB0021910635DC72E8E860BE43C28E5D53243D6DC247B7" + "D4F18C20195E80DEDCC75B29C43CE5047AD775B65BFC93589BD748B950C68BAD" + @@ -170,7 +170,7 @@ public static void ReadRsaPkcs1SimpleDocument() Assert.Equal(SubjectIdentifierType.IssuerAndSerialNumber, signer.SignerIdentifier.Type); Assert.Equal(Oids.Sha1, signer.DigestAlgorithm.Value); -#if NETCOREAPP +#if NET Assert.Equal(Oids.Rsa, signer.SignatureAlgorithm.Value); Assert.Equal( @@ -237,7 +237,7 @@ public static void ReadRsaPkcs1CounterSigned() Assert.Equal(SubjectIdentifierType.IssuerAndSerialNumber, signer.SignerIdentifier.Type); Assert.Equal(Oids.Sha1, signer.DigestAlgorithm.Value); -#if NETCOREAPP +#if NET Assert.Equal(Oids.Rsa, signer.SignatureAlgorithm.Value); Assert.Equal( @@ -311,7 +311,7 @@ public static void CheckNoSignatureDocument() Assert.Null(signer.Certificate); Assert.Equal(Oids.Sha1, signer.DigestAlgorithm.Value); -#if NETCOREAPP +#if NET Assert.Equal("1.3.6.1.5.5.7.6.2", signer.SignatureAlgorithm.Value); Assert.Equal( @@ -370,7 +370,7 @@ public static void CheckNoSignatureDocument() "833378066BDCCBA7047EF6919843D181A57D6479", csMessageDigest.MessageDigest.ByteArrayToHex()); -#if NETCOREAPP +#if NET Assert.Equal(Oids.Rsa, counterSigner.SignatureAlgorithm.Value); Assert.Equal( @@ -447,7 +447,7 @@ public static void NonEmbeddedCertificate() Assert.Empty(signer.CounterSignerInfos); Assert.Null(signer.Certificate); -#if NETCOREAPP +#if NET Assert.Equal(Oids.Rsa, signer.SignatureAlgorithm.Value); Assert.Equal( @@ -551,7 +551,7 @@ public static void ReadRsaPkcs1DoubleCounterSigned() Assert.Equal(SubjectIdentifierType.IssuerAndSerialNumber, signer.SignerIdentifier.Type); Assert.Equal(Oids.Sha1, signer.DigestAlgorithm.Value); -#if NETCOREAPP +#if NET Assert.Equal(Oids.Rsa, signer.SignatureAlgorithm.Value); Assert.Equal( @@ -597,7 +597,7 @@ public static void ReadRsaPkcs1DoubleCounterSigned() // Assert.NotThrows cms.CheckSignature(true); -#if NETCOREAPP +#if NET 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 10a51fc819545a..37d8b29ddc5d11 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs @@ -100,7 +100,7 @@ public static void SignerInfo_CounterSignerInfos_UniquePerCall_WhenNonEmpty() Assert.NotSame(counterSigner.Certificate, counterSigner2.Certificate); Assert.Equal(counterSigner.Certificate, counterSigner2.Certificate); -#if NETCOREAPP +#if NET byte[] signature = counterSigner.GetSignature(); byte[] signature2 = counterSigner2.GetSignature(); @@ -110,7 +110,7 @@ public static void SignerInfo_CounterSignerInfos_UniquePerCall_WhenNonEmpty() } } -#if NETCOREAPP +#if NET [Fact] public static void SignerInfo_GetSignature_UniquePerCall() { @@ -139,7 +139,7 @@ public static void SignerInfo_DigestAlgorithm_NotSame() Assert.NotSame(oid, oid2); } -#if NETCOREAPP +#if NET [Fact] public static void SignerInfo_SignatureAlgorithm_NotSame() { @@ -745,7 +745,7 @@ public static void AddCounterSigner_DSA() Assert.NotEqual(firstSigner2.Certificate, counterSigner.Certificate); Assert.Equal(2, cms.Certificates.Count); -#if NETCOREAPP +#if NET byte[] signature = counterSigner.GetSignature(); Assert.NotEmpty(signature); // DSA PKIX signature format is a DER SEQUENCE. @@ -813,7 +813,7 @@ public static void AddCounterSigner_ECDSA(SubjectIdentifierType identifierType, Assert.NotEqual(firstSigner2.Certificate, counterSigner.Certificate); Assert.Equal(2, cms.Certificates.Count); -#if NETCOREAPP +#if NET byte[] signature = counterSigner.GetSignature(); Assert.NotEmpty(signature); // DSA PKIX signature format is a DER SEQUENCE. diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CryptoHelpers.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CryptoHelpers.cs index 17fedbe3daa9a0..5a6ece8b2d6c9b 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CryptoHelpers.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CryptoHelpers.cs @@ -50,7 +50,7 @@ internal static class CryptoHelpers [RequiresDynamicCode(XsltRequiresDynamicCodeMessage)] private static XmlDsigXsltTransform CreateXmlDsigXsltTransform() { -#if NETCOREAPP +#if NET if (!RuntimeFeature.IsDynamicCodeSupported) { // XSLTs are only supported when dynamic code is supported. See https://github.com/dotnet/runtime/issues/84389 @@ -73,7 +73,7 @@ private static XmlDsigXsltTransform CreateXmlDsigXsltTransform() { return (CryptoConfig.CreateFromName(name) ?? CreateFromKnownName(name)) as T; } -#if NETCOREAPP +#if NET catch (NotSupportedException) { if (name == "http://www.w3.org/TR/1999/REC-xslt-19991116") diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSASignatureDescription.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSASignatureDescription.cs index 22b1c4c355a79b..46e214ab54fa56 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSASignatureDescription.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSASignatureDescription.cs @@ -17,7 +17,7 @@ public DSASignatureDescription() DigestAlgorithm = "SHA1"; } -#if NETCOREAPP +#if NET [RequiresUnreferencedCode("CreateDeformatter is not trim compatible because the algorithm implementation referenced by DeformatterAlgorithm might be removed.")] #endif public sealed override AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key) @@ -28,7 +28,7 @@ public sealed override AsymmetricSignatureDeformatter CreateDeformatter(Asymmetr return item; } -#if NETCOREAPP +#if NET [RequiresUnreferencedCode("CreateFormatter is not trim compatible because the algorithm implementation referenced by FormatterAlgorithm might be removed.")] #endif public sealed override AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key) diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SignatureDescription.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SignatureDescription.cs index 6d5a8fd733e03a..28e0850891d8a1 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SignatureDescription.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SignatureDescription.cs @@ -15,7 +15,7 @@ public RSAPKCS1SignatureDescription(string hashAlgorithmName) DigestAlgorithm = hashAlgorithmName; } -#if NETCOREAPP +#if NET [RequiresUnreferencedCode("CreateDeformatter is not trim compatible because the algorithm implementation referenced by DeformatterAlgorithm might be removed.")] #endif public sealed override AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key) @@ -26,7 +26,7 @@ public sealed override AsymmetricSignatureDeformatter CreateDeformatter(Asymmetr return item; } -#if NETCOREAPP +#if NET [RequiresUnreferencedCode("CreateFormatter is not trim compatible because the algorithm implementation referenced by FormatterAlgorithm might be removed.")] #endif public sealed override AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key) @@ -37,7 +37,7 @@ public sealed override AsymmetricSignatureFormatter CreateFormatter(AsymmetricAl return item; } -#if NETCOREAPP +#if NET [RequiresUnreferencedCode("CreateDigest is not trim compatible because the algorithm implementation referenced by DigestAlgorithm might be removed.")] #endif public abstract override HashAlgorithm CreateDigest(); diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/Utils.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/Utils.cs index de7bc2b9b77b7e..5505994fd82933 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/Utils.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/Utils.cs @@ -761,7 +761,7 @@ internal static bool IsSelfSigned(X509Chain chain) { AsymmetricAlgorithm? algorithm = (AsymmetricAlgorithm?)certificate.GetRSAPublicKey() ?? certificate.GetECDsaPublicKey(); -#if NETCOREAPP +#if NET if (algorithm is null && !OperatingSystem.IsTvOS() && !OperatingSystem.IsIOS()) { algorithm = certificate.GetDSAPublicKey(); diff --git a/src/libraries/System.Security.Cryptography.Xml/tests/ReferenceTest.cs b/src/libraries/System.Security.Cryptography.Xml/tests/ReferenceTest.cs index a28065dac5a310..db65e8de538167 100644 --- a/src/libraries/System.Security.Cryptography.Xml/tests/ReferenceTest.cs +++ b/src/libraries/System.Security.Cryptography.Xml/tests/ReferenceTest.cs @@ -131,7 +131,7 @@ public void LoadXPathTransforms() [ConditionalFact] public void LoadXsltTransforms() { -#if NETCOREAPP +#if NET if (!RuntimeFeature.IsDynamicCodeSupported) { throw new SkipTestException("XSLTs are only supported when dynamic code is supported. See https://github.com/dotnet/runtime/issues/84389"); @@ -167,7 +167,7 @@ public void LoadAllTransforms() xsltTransform += ""; xsltTransform += ""; int expectedTransformsCount = 6; -#if NETCOREAPP +#if NET if (!RuntimeFeature.IsDynamicCodeSupported) { // XSLTs are only supported when dynamic code is supported. See https://github.com/dotnet/runtime/issues/84389 diff --git a/src/libraries/System.Security.Cryptography.Xml/tests/Samples/SigningVerifyingX509Cert.cs b/src/libraries/System.Security.Cryptography.Xml/tests/Samples/SigningVerifyingX509Cert.cs index 37431c1e53c124..69af96accd8db0 100644 --- a/src/libraries/System.Security.Cryptography.Xml/tests/Samples/SigningVerifyingX509Cert.cs +++ b/src/libraries/System.Security.Cryptography.Xml/tests/Samples/SigningVerifyingX509Cert.cs @@ -87,7 +87,7 @@ public void SignedXmlHasDSACertificateVerifiableSignature() xmlDoc.PreserveWhitespace = true; xmlDoc.LoadXml(ExampleXml); -#if NETCOREAPP +#if NET using (DSA key = x509cert.GetDSAPrivateKey()) { SignXml(xmlDoc, key); diff --git a/src/libraries/System.Security.Cryptography.Xml/tests/SignedXmlTest.cs b/src/libraries/System.Security.Cryptography.Xml/tests/SignedXmlTest.cs index bd22c5b835eed8..54c153694f7bf7 100644 --- a/src/libraries/System.Security.Cryptography.Xml/tests/SignedXmlTest.cs +++ b/src/libraries/System.Security.Cryptography.Xml/tests/SignedXmlTest.cs @@ -1673,7 +1673,7 @@ static byte[] GetResponse() => try { -#if NETCOREAPP +#if NET socket = await listener.AcceptSocketAsync(cancellationToken); #else socket = await listener.AcceptSocketAsync(); diff --git a/src/libraries/System.Security.Cryptography.Xml/tests/TestHelpers.cs b/src/libraries/System.Security.Cryptography.Xml/tests/TestHelpers.cs index 16364a4315c354..17e498325abb27 100644 --- a/src/libraries/System.Security.Cryptography.Xml/tests/TestHelpers.cs +++ b/src/libraries/System.Security.Cryptography.Xml/tests/TestHelpers.cs @@ -229,7 +229,7 @@ internal static DSA GetWorkingDSA() { DSA dsa = DSA.Create(); -#if NETCOREAPP +#if NET if (OperatingSystem.IsMacOS()) { // macOS cannot generate DSA keys, so for this platform we will use a fixed key. diff --git a/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithm/Trivial.cs b/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithm/Trivial.cs index 1fb2f0306aa8ef..97a6ba6d3548ae 100644 --- a/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithm/Trivial.cs +++ b/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithm/Trivial.cs @@ -51,7 +51,7 @@ public static void ValidKeySizeUsesProperty() } } -#if NETCOREAPP +#if NET [Fact] public static void ClearCallsDispose() { diff --git a/src/libraries/System.Security.Cryptography/tests/DefaultDSAProvider.cs b/src/libraries/System.Security.Cryptography/tests/DefaultDSAProvider.cs index e04a1ce81f2602..03c3bf5d02a349 100644 --- a/src/libraries/System.Security.Cryptography/tests/DefaultDSAProvider.cs +++ b/src/libraries/System.Security.Cryptography/tests/DefaultDSAProvider.cs @@ -12,7 +12,7 @@ public DSA Create() public DSA Create(int keySize) { -#if NETCOREAPP +#if NET return DSA.Create(keySize); #else DSA dsa = Create(); diff --git a/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.cs index 001869125e0ca5..91015c49a39f4e 100644 --- a/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.cs +++ b/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.cs @@ -19,7 +19,7 @@ public ECDsa Create(int keySize) return ec; } -#if NETCOREAPP +#if NET public ECDsa Create(ECCurve curve) { return ECDsa.Create(curve); diff --git a/src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs b/src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs index c65b78ace1288e..ab19c2aa03344a 100644 --- a/src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs +++ b/src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs @@ -15,7 +15,7 @@ public class DefaultRSAProvider : IRSAProvider public RSA Create(int keySize) { -#if NETCOREAPP +#if NET return RSA.Create(keySize); #else RSA rsa = Create(); diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/CertificateRequestUsageTests.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/CertificateRequestUsageTests.cs index e65a0445b09b28..8c434619d72eb0 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/CertificateRequestUsageTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/CertificateRequestUsageTests.cs @@ -551,7 +551,7 @@ public static void InvalidSignatureAlgorithmEncoding(string caseName, string sig Exception exception = Assert.Throws( () => request.Create(request.SubjectName, generator, now, now.AddDays(1), new byte[1])); -#if NETCOREAPP +#if NET if (CultureInfo.CurrentCulture.Name == "en-US") { Assert.Contains("ASN1", exception.Message, StringComparison.OrdinalIgnoreCase); diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/X509StoreTests.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/X509StoreTests.cs index 0c8e374018564d..fb286e393c98d6 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/X509StoreTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/X509StoreTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#if NETCOREAPP +#if NET #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 4d9a824761f533..c4f0228c054129 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 @@ -15,7 +15,7 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Permissions.SecurityPermissionFlag))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Policy.Evidence))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Policy.EvidenceBase))] -#if NETCOREAPP +#if NET [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 512d130416ea6a..5d2fc5fabc8b31 100644 --- a/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs +++ b/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs @@ -17,7 +17,7 @@ void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Ser } namespace System.Configuration { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class ConfigurationPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -31,7 +31,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.All, AllowMultiple=true, Inherited=false)] @@ -43,7 +43,7 @@ public ConfigurationPermissionAttribute(System.Security.Permissions.SecurityActi } namespace System.Data.Common { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public abstract partial class DBDataPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -65,7 +65,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -84,7 +84,7 @@ protected DBDataPermissionAttribute(System.Security.Permissions.SecurityAction a } namespace System.Data.Odbc { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class OdbcPermission : System.Data.Common.DBDataPermission @@ -95,7 +95,7 @@ public OdbcPermission(System.Security.Permissions.PermissionState state, bool al public override void Add(string connectionString, string restrictions, System.Data.KeyRestrictionBehavior behavior) { } public override System.Security.IPermission Copy() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -107,7 +107,7 @@ public OdbcPermissionAttribute(System.Security.Permissions.SecurityAction action } namespace System.Data.OleDb { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class OleDbPermission : System.Data.Common.DBDataPermission @@ -120,7 +120,7 @@ public OleDbPermission(System.Security.Permissions.PermissionState state, bool a public string Provider { get { throw null; } set { } } public override System.Security.IPermission Copy() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -135,7 +135,7 @@ public OleDbPermissionAttribute(System.Security.Permissions.SecurityAction actio } namespace System.Data.OracleClient { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class OraclePermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -151,7 +151,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -171,7 +171,7 @@ public OraclePermissionAttribute(System.Security.Permissions.SecurityAction acti } namespace System.Data.SqlClient { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class SqlClientPermission : System.Data.Common.DBDataPermission @@ -182,7 +182,7 @@ public SqlClientPermission(System.Security.Permissions.PermissionState state, bo public override void Add(string connectionString, string restrictions, System.Data.KeyRestrictionBehavior behavior) { } public override System.Security.IPermission Copy() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -194,7 +194,7 @@ public SqlClientPermissionAttribute(System.Security.Permissions.SecurityAction a } namespace System.Diagnostics { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class EventLogPermission : System.Security.Permissions.ResourcePermissionBase @@ -215,7 +215,7 @@ public enum EventLogPermissionAccess Write = 16, Administer = 48, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -249,7 +249,7 @@ protected override void OnRemove(int index, object value) { } protected override void OnSet(int index, object oldValue, object newValue) { } public void Remove(System.Diagnostics.EventLogPermissionEntry value) { } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class PerformanceCounterPermission : System.Security.Permissions.ResourcePermissionBase @@ -270,7 +270,7 @@ public enum PerformanceCounterPermissionAccess Instrument = 3, Administer = 7, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -360,7 +360,7 @@ public void Remove(System.DirectoryServices.DirectoryServicesPermissionEntry val } namespace System.Drawing.Printing { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class PrintingPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -376,7 +376,7 @@ public override void FromXml(System.Security.SecurityElement element) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.All, AllowMultiple=true)] @@ -396,7 +396,7 @@ public enum PrintingPermissionLevel } namespace System.Net { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class DnsPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -410,7 +410,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -434,7 +434,7 @@ public enum NetworkAccess Connect = 64, Accept = 128, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class SocketPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -453,7 +453,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -474,7 +474,7 @@ public enum TransportType Tcp = 2, All = 3, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class WebPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -495,7 +495,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -517,7 +517,7 @@ public enum SmtpAccess Connect = 1, ConnectToUnrestrictedPort = 2, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class SmtpPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -535,7 +535,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -555,7 +555,7 @@ public enum NetworkInformationAccess Read = 1, Ping = 4, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class NetworkInformationPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -572,7 +572,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -585,7 +585,7 @@ public NetworkInformationPermissionAttribute(System.Security.Permissions.Securit } namespace System.Net.PeerToPeer { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class PnrpPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -599,7 +599,7 @@ public override void FromXml(System.Security.SecurityElement e) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -618,7 +618,7 @@ public enum PnrpScope } namespace System.Net.PeerToPeer.Collaboration { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class PeerCollaborationPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -632,7 +632,7 @@ public override void FromXml(System.Security.SecurityElement e) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -644,7 +644,7 @@ public PeerCollaborationPermissionAttribute(System.Security.Permissions.Security } namespace System.Security { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public abstract partial class CodeAccessPermission : System.Security.IPermission, System.Security.ISecurityEncodable, System.Security.IStackWalk @@ -670,7 +670,7 @@ public static void RevertPermitOnly() { } public abstract System.Security.SecurityElement ToXml(); public virtual System.Security.IPermission Union(System.Security.IPermission other) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public partial class HostProtectionException : System.SystemException @@ -723,7 +723,7 @@ public partial interface ISecurityPolicyEncodable void FromXml(System.Security.SecurityElement e, System.Security.Policy.PolicyLevel level); System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level); } -#if !NETCOREAPP +#if !NET public partial interface IStackWalk { void Assert(); @@ -732,7 +732,7 @@ public partial interface IStackWalk void PermitOnly(); } #endif -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class NamedPermissionSet : System.Security.PermissionSet @@ -750,7 +750,7 @@ public override void FromXml(System.Security.SecurityElement et) { } public override int GetHashCode() { throw null; } public override System.Security.SecurityElement ToXml() { throw null; } } -#if !NETCOREAPP +#if !NET 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) { } @@ -800,7 +800,7 @@ public enum PolicyLevelType Enterprise = 2, AppDomain = 3, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class SecurityContext : System.IDisposable @@ -821,7 +821,7 @@ public enum SecurityContextSource CurrentAppDomain = 0, CurrentAssembly = 1, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public static partial class SecurityManager @@ -882,7 +882,7 @@ public XmlSyntaxException(string message, System.Exception inner) { } } namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class DataProtectionPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -898,7 +898,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -912,7 +912,7 @@ public DataProtectionPermissionAttribute(System.Security.Permissions.SecurityAct public bool UnprotectMemory { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.FlagsAttribute] @@ -925,7 +925,7 @@ public enum DataProtectionPermissionFlags UnprotectMemory = 8, AllFlags = 15, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class EnvironmentPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -943,7 +943,7 @@ public void SetPathList(System.Security.Permissions.EnvironmentPermissionAccess public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.FlagsAttribute] @@ -954,7 +954,7 @@ public enum EnvironmentPermissionAccess Write = 2, AllAccess = 3, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -966,7 +966,7 @@ public EnvironmentPermissionAttribute(System.Security.Permissions.SecurityAction public string Write { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class FileDialogPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -982,7 +982,7 @@ public override void FromXml(System.Security.SecurityElement esd) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.FlagsAttribute] @@ -993,7 +993,7 @@ public enum FileDialogPermissionAccess Save = 2, OpenSave = 3, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1004,7 +1004,7 @@ public FileDialogPermissionAttribute(System.Security.Permissions.SecurityAction public bool Save { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class FileIOPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1031,7 +1031,7 @@ public void SetPathList(System.Security.Permissions.FileIOPermissionAccess acces public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.FlagsAttribute] @@ -1044,7 +1044,7 @@ public enum FileIOPermissionAccess PathDiscovery = 8, AllAccess = 15, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1064,7 +1064,7 @@ public FileIOPermissionAttribute(System.Security.Permissions.SecurityAction acti public string Write { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class GacIdentityPermission : System.Security.CodeAccessPermission @@ -1078,7 +1078,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1087,7 +1087,7 @@ public sealed partial class GacIdentityPermissionAttribute : System.Security.Per public GacIdentityPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1107,7 +1107,7 @@ public HostProtectionAttribute(System.Security.Permissions.SecurityAction action public bool UI { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.FlagsAttribute] @@ -1125,7 +1125,7 @@ public enum HostProtectionResource MayLeakOnAbort = 256, All = 511, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public enum IsolatedStorageContainment @@ -1143,7 +1143,7 @@ public enum IsolatedStorageContainment AdministerIsolatedStorageByUser = 112, UnrestrictedIsolatedStorage = 240, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class IsolatedStorageFilePermission : System.Security.Permissions.IsolatedStoragePermission @@ -1155,7 +1155,7 @@ public IsolatedStorageFilePermission(System.Security.Permissions.PermissionState public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1164,7 +1164,7 @@ public sealed partial class IsolatedStorageFilePermissionAttribute : System.Secu public IsolatedStorageFilePermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public abstract partial class IsolatedStoragePermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1176,7 +1176,7 @@ public override void FromXml(System.Security.SecurityElement esd) { } public bool IsUnrestricted() { throw null; } public override System.Security.SecurityElement ToXml() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public abstract partial class IsolatedStoragePermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute @@ -1185,14 +1185,14 @@ protected IsolatedStoragePermissionAttribute(System.Security.Permissions.Securit public System.Security.Permissions.IsolatedStorageContainment UsageAllowed { get { throw null; } set { } } public long UserQuota { get { throw null; } set { } } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public partial interface IUnrestrictedPermission { bool IsUnrestricted(); } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class KeyContainerPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1210,7 +1210,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class KeyContainerPermissionAccessEntry @@ -1227,7 +1227,7 @@ public KeyContainerPermissionAccessEntry(string keyStore, string providerName, i public override bool Equals(object o) { throw null; } public override int GetHashCode() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class KeyContainerPermissionAccessEntryCollection : System.Collections.ICollection, System.Collections.IEnumerable @@ -1246,7 +1246,7 @@ public void CopyTo(System.Security.Permissions.KeyContainerPermissionAccessEntry public void Remove(System.Security.Permissions.KeyContainerPermissionAccessEntry accessEntry) { } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class KeyContainerPermissionAccessEntryEnumerator : System.Collections.IEnumerator @@ -1257,7 +1257,7 @@ public KeyContainerPermissionAccessEntryEnumerator() { } public bool MoveNext() { throw null; } public void Reset() { } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1272,7 +1272,7 @@ public KeyContainerPermissionAttribute(System.Security.Permissions.SecurityActio public int ProviderType { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public enum KeyContainerPermissionFlags @@ -1289,7 +1289,7 @@ public enum KeyContainerPermissionFlags ChangeAcl = 8192, AllFlags = 13111, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class MediaPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1311,7 +1311,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1323,7 +1323,7 @@ public MediaPermissionAttribute(System.Security.Permissions.SecurityAction actio public System.Security.Permissions.MediaPermissionVideo Video { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public enum MediaPermissionAudio @@ -1333,7 +1333,7 @@ public enum MediaPermissionAudio SafeAudio = 2, AllAudio = 3, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public enum MediaPermissionImage @@ -1343,7 +1343,7 @@ public enum MediaPermissionImage SafeImage = 2, AllImage = 3, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public enum MediaPermissionVideo @@ -1353,7 +1353,7 @@ public enum MediaPermissionVideo SafeVideo = 2, AllVideo = 3, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1368,14 +1368,14 @@ public PermissionSetAttribute(System.Security.Permissions.SecurityAction action) public override System.Security.IPermission CreatePermission() { throw null; } public System.Security.PermissionSet CreatePermissionSet() { throw null; } } -#if !NETCOREAPP +#if !NET public enum PermissionState { None = 0, Unrestricted = 1, } #endif -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class PrincipalPermission : System.Security.IPermission, System.Security.ISecurityEncodable, System.Security.Permissions.IUnrestrictedPermission @@ -1395,13 +1395,13 @@ public void FromXml(System.Security.SecurityElement elem) { } public System.Security.SecurityElement ToXml() { throw null; } public System.Security.IPermission Union(System.Security.IPermission other) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=false)] public sealed partial class PrincipalPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("PrincipalPermissionAttribute is not honored by the runtime and must not be used.", true, DiagnosticId = "SYSLIB0002", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public PrincipalPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { } @@ -1410,7 +1410,7 @@ public PrincipalPermissionAttribute(System.Security.Permissions.SecurityAction a public string Role { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class PublisherIdentityPermission : System.Security.CodeAccessPermission @@ -1425,7 +1425,7 @@ public override void FromXml(System.Security.SecurityElement esd) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1437,7 +1437,7 @@ public PublisherIdentityPermissionAttribute(System.Security.Permissions.Security public string X509Certificate { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class ReflectionPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1453,7 +1453,7 @@ public override void FromXml(System.Security.SecurityElement esd) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1469,7 +1469,7 @@ public ReflectionPermissionAttribute(System.Security.Permissions.SecurityAction public bool TypeInformation { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.FlagsAttribute] @@ -1485,7 +1485,7 @@ public enum ReflectionPermissionFlag AllFlags = 7, RestrictedMemberAccess = 8, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class RegistryPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1505,7 +1505,7 @@ public void SetPathList(System.Security.Permissions.RegistryPermissionAccess acc public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.FlagsAttribute] @@ -1517,7 +1517,7 @@ public enum RegistryPermissionAccess Create = 4, AllAccess = 7, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1534,7 +1534,7 @@ public RegistryPermissionAttribute(System.Security.Permissions.SecurityAction ac public string Write { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public abstract partial class ResourcePermissionBase : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1557,7 +1557,7 @@ protected void RemovePermissionAccess(System.Security.Permissions.ResourcePermis public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public partial class ResourcePermissionBaseEntry @@ -1567,7 +1567,7 @@ public ResourcePermissionBaseEntry(int permissionAccess, string[] permissionAcce public int PermissionAccess { get { throw null; } } public string[] PermissionAccessPath { get { throw null; } } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class SecurityPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1583,7 +1583,7 @@ public override void FromXml(System.Security.SecurityElement esd) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class SiteIdentityPermission : System.Security.CodeAccessPermission @@ -1598,7 +1598,7 @@ public override void FromXml(System.Security.SecurityElement esd) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1608,7 +1608,7 @@ public SiteIdentityPermissionAttribute(System.Security.Permissions.SecurityActio public string Site { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class StorePermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1624,7 +1624,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1641,7 +1641,7 @@ public StorePermissionAttribute(System.Security.Permissions.SecurityAction actio public bool RemoveFromStore { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.FlagsAttribute] @@ -1657,7 +1657,7 @@ public enum StorePermissionFlags EnumerateCertificates = 128, AllFlags = 247, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class StrongNameIdentityPermission : System.Security.CodeAccessPermission @@ -1674,7 +1674,7 @@ public override void FromXml(System.Security.SecurityElement e) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1686,7 +1686,7 @@ public StrongNameIdentityPermissionAttribute(System.Security.Permissions.Securit public string Version { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class StrongNamePublicKeyBlob @@ -1696,7 +1696,7 @@ public StrongNamePublicKeyBlob(byte[] publicKey) { } public override int GetHashCode() { throw null; } public override string ToString() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class TypeDescriptorPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1712,7 +1712,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1723,7 +1723,7 @@ public TypeDescriptorPermissionAttribute(System.Security.Permissions.SecurityAct public bool RestrictedRegistrationAccess { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.FlagsAttribute] @@ -1732,7 +1732,7 @@ public enum TypeDescriptorPermissionFlags NoFlags = 0, RestrictedRegistrationAccess = 1, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class UIPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1751,7 +1751,7 @@ public override void FromXml(System.Security.SecurityElement esd) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1762,7 +1762,7 @@ public UIPermissionAttribute(System.Security.Permissions.SecurityAction action) public System.Security.Permissions.UIPermissionWindow Window { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public enum UIPermissionClipboard @@ -1771,7 +1771,7 @@ public enum UIPermissionClipboard OwnClipboard = 1, AllClipboard = 2, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public enum UIPermissionWindow @@ -1781,7 +1781,7 @@ public enum UIPermissionWindow SafeTopLevelWindows = 2, AllWindows = 3, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class UrlIdentityPermission : System.Security.CodeAccessPermission @@ -1796,7 +1796,7 @@ public override void FromXml(System.Security.SecurityElement esd) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1806,7 +1806,7 @@ public UrlIdentityPermissionAttribute(System.Security.Permissions.SecurityAction public string Url { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class WebBrowserPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -1823,7 +1823,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1833,7 +1833,7 @@ public WebBrowserPermissionAttribute(System.Security.Permissions.SecurityAction public System.Security.Permissions.WebBrowserPermissionLevel Level { get { throw null; } set { } } public override System.Security.IPermission CreatePermission() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public enum WebBrowserPermissionLevel @@ -1842,7 +1842,7 @@ public enum WebBrowserPermissionLevel Safe = 1, Unrestricted = 2, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class ZoneIdentityPermission : System.Security.CodeAccessPermission @@ -1857,7 +1857,7 @@ public override void FromXml(System.Security.SecurityElement esd) { } public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)] @@ -1909,14 +1909,14 @@ public sealed partial class ApplicationTrust : System.Security.Policy.EvidenceBa { public ApplicationTrust() { } public ApplicationTrust(System.ApplicationIdentity identity) { } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public ApplicationTrust(System.Security.PermissionSet defaultGrantSet, System.Collections.Generic.IEnumerable fullTrustAssemblies) { } public System.ApplicationIdentity ApplicationIdentity { get { throw null; } set { } } public System.Security.Policy.PolicyStatement DefaultGrantSet { get { throw null; } set { } } public object ExtraInfo { get { throw null; } set { } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public System.Collections.Generic.IList FullTrustAssemblies { get { throw null; } } @@ -2000,7 +2000,7 @@ public void RemoveChild(System.Security.Policy.CodeGroup group) { } public System.Security.SecurityElement ToXml() { throw null; } public System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class FileCodeGroup : System.Security.Policy.CodeGroup @@ -2026,7 +2026,7 @@ public sealed partial class FirstMatchCodeGroup : System.Security.Policy.CodeGro public override System.Security.Policy.PolicyStatement Resolve(System.Security.Policy.Evidence evidence) { throw null; } public override System.Security.Policy.CodeGroup ResolveMatchingCodeGroups(System.Security.Policy.Evidence evidence) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class GacInstalled : System.Security.Policy.EvidenceBase, System.Security.Policy.IIdentityPermissionFactory @@ -2085,7 +2085,7 @@ void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Ser public System.Security.SecurityElement ToXml() { throw null; } public System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public partial interface IIdentityPermissionFactory @@ -2153,18 +2153,18 @@ internal PolicyLevel() { } public void AddFullTrustAssembly(System.Security.Policy.StrongName sn) { } [Obsolete("Because all GAC assemblies always get full trust, the full trust list is no longer meaningful. You should install any assemblies that are used in security policy in the GAC to ensure they are trusted.")] public void AddFullTrustAssembly(System.Security.Policy.StrongNameMembershipCondition snMC) { } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public void AddNamedPermissionSet(System.Security.NamedPermissionSet permSet) { } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public System.Security.NamedPermissionSet ChangeNamedPermissionSet(string name, System.Security.PermissionSet pSet) { throw null; } [System.ObsoleteAttribute("AppDomain policy levels are obsolete. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")] public static System.Security.Policy.PolicyLevel CreateAppDomainLevel() { throw null; } public void FromXml(System.Security.SecurityElement e) { } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public System.Security.NamedPermissionSet GetNamedPermissionSet(string name) { throw null; } @@ -2173,11 +2173,11 @@ public void Recover() { } public void RemoveFullTrustAssembly(System.Security.Policy.StrongName sn) { } [Obsolete("Because all GAC assemblies always get full trust, the full trust list is no longer meaningful. You should install any assemblies that are used in security policy in the GAC to ensure they are trusted.")] public void RemoveFullTrustAssembly(System.Security.Policy.StrongNameMembershipCondition snMC) { } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public System.Security.NamedPermissionSet RemoveNamedPermissionSet(System.Security.NamedPermissionSet permSet) { throw null; } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public System.Security.NamedPermissionSet RemoveNamedPermissionSet(string name) { throw null; } @@ -2188,17 +2188,17 @@ public void Reset() { } } public sealed partial class PolicyStatement : System.Security.ISecurityEncodable, System.Security.ISecurityPolicyEncodable { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public PolicyStatement(System.Security.PermissionSet permSet) { } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public PolicyStatement(System.Security.PermissionSet permSet, System.Security.Policy.PolicyStatementAttribute attributes) { } public System.Security.Policy.PolicyStatementAttribute Attributes { get { throw null; } set { } } public string AttributeString { get { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public System.Security.PermissionSet PermissionSet { get { throw null; } set { } } @@ -2218,7 +2218,7 @@ public enum PolicyStatementAttribute LevelFinal = 2, All = 3, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class Publisher : System.Security.Policy.EvidenceBase, System.Security.Policy.IIdentityPermissionFactory @@ -2245,7 +2245,7 @@ public void FromXml(System.Security.SecurityElement e, System.Security.Policy.Po public System.Security.SecurityElement ToXml() { throw null; } public System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class Site : System.Security.Policy.EvidenceBase, System.Security.Policy.IIdentityPermissionFactory @@ -2273,7 +2273,7 @@ public void FromXml(System.Security.SecurityElement e, System.Security.Policy.Po public System.Security.SecurityElement ToXml() { throw null; } public System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class StrongName : System.Security.Policy.EvidenceBase, System.Security.Policy.IIdentityPermissionFactory @@ -2288,7 +2288,7 @@ public StrongName(System.Security.Permissions.StrongNamePublicKeyBlob blob, stri public override int GetHashCode() { throw null; } public override string ToString() { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class StrongNameMembershipCondition : System.Security.ISecurityEncodable, System.Security.ISecurityPolicyEncodable, System.Security.Policy.IMembershipCondition @@ -2333,7 +2333,7 @@ public sealed partial class UnionCodeGroup : System.Security.Policy.CodeGroup public override System.Security.Policy.PolicyStatement Resolve(System.Security.Policy.Evidence evidence) { throw null; } public override System.Security.Policy.CodeGroup ResolveMatchingCodeGroups(System.Security.Policy.Evidence evidence) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class Url : System.Security.Policy.EvidenceBase, System.Security.Policy.IIdentityPermissionFactory @@ -2360,7 +2360,7 @@ public void FromXml(System.Security.SecurityElement e, System.Security.Policy.Po public System.Security.SecurityElement ToXml() { throw null; } public System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class Zone : System.Security.Policy.EvidenceBase, System.Security.Policy.IIdentityPermissionFactory @@ -2391,7 +2391,7 @@ public void FromXml(System.Security.SecurityElement e, System.Security.Policy.Po } namespace System.ServiceProcess { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class ServiceControllerPermission : System.Security.Permissions.ResourcePermissionBase @@ -2409,7 +2409,7 @@ public enum ServiceControllerPermissionAccess Browse = 2, Control = 6, } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple = true, Inherited = false)] @@ -2449,7 +2449,7 @@ public void Remove(System.ServiceProcess.ServiceControllerPermissionEntry value) } namespace System.Transactions { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class DistributedTransactionPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -2463,7 +2463,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.All, AllowMultiple=true)] @@ -2476,7 +2476,7 @@ public DistributedTransactionPermissionAttribute(System.Security.Permissions.Sec } namespace System.Web { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class AspNetHostingPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission @@ -2492,7 +2492,7 @@ public override void FromXml(System.Security.SecurityElement securityElement) { public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif [System.AttributeUsageAttribute(System.AttributeTargets.All, AllowMultiple=true, Inherited=false)] diff --git a/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.netcoreapp.cs b/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.netcoreapp.cs index bd7e4dd59a6c7b..f3e0de569038cb 100644 --- a/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.netcoreapp.cs +++ b/src/libraries/System.Security.Permissions/ref/System.Security.Permissions.netcoreapp.cs @@ -6,7 +6,7 @@ namespace System.Xaml.Permissions { -#if NETCOREAPP +#if NET [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public sealed partial class XamlLoadPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Configuration/ConfigurationPermission.cs b/src/libraries/System.Security.Permissions/src/System/Configuration/ConfigurationPermission.cs index 3adc471ddc8949..47967148e4b60c 100644 --- a/src/libraries/System.Security.Permissions/src/System/Configuration/ConfigurationPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Configuration/ConfigurationPermission.cs @@ -6,7 +6,7 @@ namespace System.Configuration { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class ConfigurationPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Configuration/ConfigurationPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Configuration/ConfigurationPermissionAttribute.cs index 8366e422d9172f..43a98812096e14 100644 --- a/src/libraries/System.Security.Permissions/src/System/Configuration/ConfigurationPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Configuration/ConfigurationPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Configuration { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermission.cs b/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermission.cs index 93b727f99073f2..3982f48df334ff 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermission.cs @@ -6,7 +6,7 @@ namespace System.Data.Common { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public abstract class DBDataPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermissionAttribute.cs index 9968cb6d565abb..ac1e409a951df6 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermissionAttribute.cs @@ -5,7 +5,7 @@ namespace System.Data.Common { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, diff --git a/src/libraries/System.Security.Permissions/src/System/Data/Odbc/OdbcPermission.cs b/src/libraries/System.Security.Permissions/src/System/Data/Odbc/OdbcPermission.cs index 6504d49d88814b..2dca7ee412de82 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/Odbc/OdbcPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/Odbc/OdbcPermission.cs @@ -7,7 +7,7 @@ namespace System.Data.Odbc { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class OdbcPermission : DBDataPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Data/Odbc/OdbcPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Data/Odbc/OdbcPermissionAttribute.cs index c6286aa49ba751..e0bd5ec1abf82d 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/Odbc/OdbcPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/Odbc/OdbcPermissionAttribute.cs @@ -7,7 +7,7 @@ namespace System.Data.Odbc { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | diff --git a/src/libraries/System.Security.Permissions/src/System/Data/OleDb/OleDbPermission.cs b/src/libraries/System.Security.Permissions/src/System/Data/OleDb/OleDbPermission.cs index d71f863adcf374..7b162ca30c2696 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/OleDb/OleDbPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/OleDb/OleDbPermission.cs @@ -7,7 +7,7 @@ namespace System.Data.OleDb { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class OleDbPermission : DBDataPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Data/OleDb/OleDbPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Data/OleDb/OleDbPermissionAttribute.cs index c4e0aca2d7a287..c5e90d99441762 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/OleDb/OleDbPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/OleDb/OleDbPermissionAttribute.cs @@ -7,7 +7,7 @@ namespace System.Data.OleDb { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | diff --git a/src/libraries/System.Security.Permissions/src/System/Data/OracleClient/OraclePermission.cs b/src/libraries/System.Security.Permissions/src/System/Data/OracleClient/OraclePermission.cs index a0389c9a0be15f..3517fd1cb4ee9d 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/OracleClient/OraclePermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/OracleClient/OraclePermission.cs @@ -6,7 +6,7 @@ namespace System.Data.OracleClient { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class OraclePermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Data/OracleClient/OraclePermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Data/OracleClient/OraclePermissionAttribute.cs index 639d38aa48e91e..bc7175def787ec 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/OracleClient/OraclePermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/OracleClient/OraclePermissionAttribute.cs @@ -5,7 +5,7 @@ namespace System.Data.OracleClient { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | diff --git a/src/libraries/System.Security.Permissions/src/System/Data/SqlClient/SqlClientPermission.cs b/src/libraries/System.Security.Permissions/src/System/Data/SqlClient/SqlClientPermission.cs index e3cc4ced62e7a2..1cd20d3ead17b6 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/SqlClient/SqlClientPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/SqlClient/SqlClientPermission.cs @@ -6,7 +6,7 @@ namespace System.Data.SqlClient { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class SqlClientPermission : DBDataPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Data/SqlClient/SqlClientPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Data/SqlClient/SqlClientPermissionAttribute.cs index 0979d37e899ff9..fffc013004f700 100644 --- a/src/libraries/System.Security.Permissions/src/System/Data/SqlClient/SqlClientPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Data/SqlClient/SqlClientPermissionAttribute.cs @@ -7,7 +7,7 @@ namespace System.Data.SqlClient { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, diff --git a/src/libraries/System.Security.Permissions/src/System/Diagnostics/EventLogPermission.cs b/src/libraries/System.Security.Permissions/src/System/Diagnostics/EventLogPermission.cs index e1e64c3c12be69..206e729cbb09c8 100644 --- a/src/libraries/System.Security.Permissions/src/System/Diagnostics/EventLogPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Diagnostics/EventLogPermission.cs @@ -5,7 +5,7 @@ namespace System.Diagnostics { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class EventLogPermission : ResourcePermissionBase diff --git a/src/libraries/System.Security.Permissions/src/System/Diagnostics/EventLogPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Diagnostics/EventLogPermissionAttribute.cs index e296e032d6ba79..a0406ccde6a240 100644 --- a/src/libraries/System.Security.Permissions/src/System/Diagnostics/EventLogPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Diagnostics/EventLogPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Diagnostics { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct diff --git a/src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermission.cs b/src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermission.cs index 49cee1607c3381..d3b0c2b6e15593 100644 --- a/src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermission.cs @@ -5,7 +5,7 @@ namespace System.Diagnostics { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class PerformanceCounterPermission : ResourcePermissionBase diff --git a/src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermissionAttribute.cs index 804e21d7d809b2..0f7322763e104b 100644 --- a/src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermissionAttribute.cs @@ -5,7 +5,7 @@ using System.Security.Permissions; namespace System.Diagnostics { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Event, diff --git a/src/libraries/System.Security.Permissions/src/System/Drawing/Printing/PrintingPermission.cs b/src/libraries/System.Security.Permissions/src/System/Drawing/Printing/PrintingPermission.cs index e429ac0b32599a..9981ec0a12d57d 100644 --- a/src/libraries/System.Security.Permissions/src/System/Drawing/Printing/PrintingPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Drawing/Printing/PrintingPermission.cs @@ -6,7 +6,7 @@ namespace System.Drawing.Printing { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class PrintingPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Drawing/Printing/PrintingPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Drawing/Printing/PrintingPermissionAttribute.cs index 654f04f6ede1f0..71c3d6e46d6581 100644 --- a/src/libraries/System.Security.Permissions/src/System/Drawing/Printing/PrintingPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Drawing/Printing/PrintingPermissionAttribute.cs @@ -5,7 +5,7 @@ namespace System.Drawing.Printing { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] diff --git a/src/libraries/System.Security.Permissions/src/System/Net/DnsPermission.cs b/src/libraries/System.Security.Permissions/src/System/Net/DnsPermission.cs index 86817bf064ea29..4bc042aa3c42aa 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/DnsPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/DnsPermission.cs @@ -6,7 +6,7 @@ namespace System.Net { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class DnsPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Net/DnsPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Net/DnsPermissionAttribute.cs index ab40a425fcaa8e..61f45a9f646d81 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/DnsPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/DnsPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Net { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | diff --git a/src/libraries/System.Security.Permissions/src/System/Net/Mail/SmtpPermission.cs b/src/libraries/System.Security.Permissions/src/System/Net/Mail/SmtpPermission.cs index d9c5c6edba6a74..4284d30ea6b87d 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/Mail/SmtpPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/Mail/SmtpPermission.cs @@ -6,7 +6,7 @@ namespace System.Net.Mail { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class SmtpPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Net/Mail/SmtpPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Net/Mail/SmtpPermissionAttribute.cs index 8d8a3379277e46..3a91cbdffafb5d 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/Mail/SmtpPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/Mail/SmtpPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Net.Mail { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | diff --git a/src/libraries/System.Security.Permissions/src/System/Net/NetworkInformation/NetworkInformationPermission.cs b/src/libraries/System.Security.Permissions/src/System/Net/NetworkInformation/NetworkInformationPermission.cs index 40a7e39426acbe..1acf38c0fd91ab 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/NetworkInformation/NetworkInformationPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/NetworkInformation/NetworkInformationPermission.cs @@ -6,7 +6,7 @@ namespace System.Net.NetworkInformation { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class NetworkInformationPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Net/NetworkInformation/NetworkInformationPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Net/NetworkInformation/NetworkInformationPermissionAttribute.cs index d25b0cf35e4e84..befe4af33830df 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/NetworkInformation/NetworkInformationPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/NetworkInformation/NetworkInformationPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Net.NetworkInformation { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/Collaboration/PeerCollaborationPermission.cs b/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/Collaboration/PeerCollaborationPermission.cs index 25627f89a6bd05..c09cceea2a47a3 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/Collaboration/PeerCollaborationPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/Collaboration/PeerCollaborationPermission.cs @@ -6,7 +6,7 @@ namespace System.Net.PeerToPeer.Collaboration { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class PeerCollaborationPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/Collaboration/PeerCollaborationPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/Collaboration/PeerCollaborationPermissionAttribute.cs index 8e171c3cd5c7f8..5fb68c79dcf682 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/Collaboration/PeerCollaborationPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/Collaboration/PeerCollaborationPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Net.PeerToPeer.Collaboration { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | diff --git a/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/PnrpPermission.cs b/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/PnrpPermission.cs index c7b3ccbdf7789a..bac836ed20b7a9 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/PnrpPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/PnrpPermission.cs @@ -6,7 +6,7 @@ namespace System.Net.PeerToPeer { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class PnrpPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/PnrpPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/PnrpPermissionAttribute.cs index b9df6e845e49ed..88b06a69b287f7 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/PnrpPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/PnrpPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Net.PeerToPeer { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | diff --git a/src/libraries/System.Security.Permissions/src/System/Net/SocketPermission.cs b/src/libraries/System.Security.Permissions/src/System/Net/SocketPermission.cs index 88e835058e7872..1e51df16e9606b 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/SocketPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/SocketPermission.cs @@ -6,7 +6,7 @@ namespace System.Net { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class SocketPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Net/SocketPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Net/SocketPermissionAttribute.cs index 88147043b9218a..cf4611a39e6e66 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/SocketPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/SocketPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Net { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | diff --git a/src/libraries/System.Security.Permissions/src/System/Net/WebPermission.cs b/src/libraries/System.Security.Permissions/src/System/Net/WebPermission.cs index e61b27b590f2d8..e7fe49c24dd72c 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/WebPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/WebPermission.cs @@ -8,7 +8,7 @@ namespace System.Net { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class WebPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Net/WebPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Net/WebPermissionAttribute.cs index 7113110a896b36..82f30ea9df7222 100644 --- a/src/libraries/System.Security.Permissions/src/System/Net/WebPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Net/WebPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Net { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | diff --git a/src/libraries/System.Security.Permissions/src/System/Security/CodeAccessPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/CodeAccessPermission.cs index 4ecc14aca2bff1..9ca3f51ce606bf 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/CodeAccessPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/CodeAccessPermission.cs @@ -3,7 +3,7 @@ namespace System.Security { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public abstract partial class CodeAccessPermission : IPermission, ISecurityEncodable, IStackWalk diff --git a/src/libraries/System.Security.Permissions/src/System/Security/HostProtectionException.cs b/src/libraries/System.Security.Permissions/src/System/Security/HostProtectionException.cs index b93a00a2a8e59b..455e045198c419 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/HostProtectionException.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/HostProtectionException.cs @@ -8,7 +8,7 @@ namespace System.Security { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Serializable] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/NamedPermissionSet.cs b/src/libraries/System.Security.Permissions/src/System/Security/NamedPermissionSet.cs index 26bfa5dae85d9b..b437033366e084 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/NamedPermissionSet.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/NamedPermissionSet.cs @@ -5,7 +5,7 @@ namespace System.Security { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class NamedPermissionSet : PermissionSet diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermission.cs index 2af3cafe200eb0..f7c18edfea5e03 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class DataProtectionPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionAttribute.cs index 5c6d99af3565a7..b3cf765ca13e34 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionFlags.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionFlags.cs index 44a442408e8f8a..80c1dd19d18012 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionFlags.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionFlags.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Flags] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermission.cs index 5c26c149475416..76f0c82c8029c4 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class EnvironmentPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAccess.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAccess.cs index b5dee502e691a8..0a7f56c80ffff0 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAccess.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAccess.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Flags] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAttribute.cs index d68a1e4842fbb4..b69d26db2be97b 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermission.cs index 6774ece3a08074..952148edcb99c4 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class FileDialogPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAccess.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAccess.cs index 80dfc8f43e1606..8d2eb8a87bd02c 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAccess.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAccess.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Flags] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAttribute.cs index a6dc55eb78b656..9f4c8b6fc8ebaa 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermission.cs index 7df64c4145df16..99e507ecd7c579 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class FileIOPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAccess.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAccess.cs index e3fb61c97b2391..029e63b1a0938d 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAccess.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAccess.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Flags] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAttribute.cs index 1780e55dde857c..702cc1fae17931 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermission.cs index a0d0abc573fdb9..39604e13f555e1 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class GacIdentityPermission : CodeAccessPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermissionAttribute.cs index bdeee8607fd10d..928f72a5b51fa4 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionAttribute.cs index 56f6d8a24bbe1c..ecf10307271e5b 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(4205), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionResource.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionResource.cs index d1db88246d0037..81e284a6564778 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionResource.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionResource.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Flags] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IUnrestrictedPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IUnrestrictedPermission.cs index a4c95a4a13fd23..04e5fa166a59a1 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IUnrestrictedPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IUnrestrictedPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public partial interface IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageContainment.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageContainment.cs index 1563eba6e790ff..4292c351f4f575 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageContainment.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageContainment.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public enum IsolatedStorageContainment diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermission.cs index fafbdca772d713..4e3535109fbc12 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class IsolatedStorageFilePermission : IsolatedStoragePermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermissionAttribute.cs index e7d95b86409154..8789e27a496d04 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermission.cs index d0d08571e6a8e5..c33e6fcae17746 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public abstract class IsolatedStoragePermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermissionAttribute.cs index 30189ad078167e..77bdd246411bb5 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public abstract class IsolatedStoragePermissionAttribute : CodeAccessSecurityAttribute diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermission.cs index 0f6a490160057f..5567368fc678a7 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class KeyContainerPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntry.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntry.cs index 771c23abb4db7c..038ab40f6d9361 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntry.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntry.cs @@ -5,7 +5,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class KeyContainerPermissionAccessEntry diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryCollection.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryCollection.cs index 4dd5f15a0d0995..f4312632fb71dc 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryCollection.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryCollection.cs @@ -5,7 +5,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class KeyContainerPermissionAccessEntryCollection : ICollection diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryEnumerator.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryEnumerator.cs index 86ed27dd250cab..e8af76d424051e 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryEnumerator.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryEnumerator.cs @@ -5,7 +5,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class KeyContainerPermissionAccessEntryEnumerator : IEnumerator diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAttribute.cs index 7211ff86ccbaf0..239772f6912b0a 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionFlags.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionFlags.cs index 50004c265344b5..0a4ece5eb35d52 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionFlags.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionFlags.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public enum KeyContainerPermissionFlags diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/MediaPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/MediaPermission.cs index 26d3b914f868ec..543f37aa11671d 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/MediaPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/MediaPermission.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public enum MediaPermissionAudio @@ -13,7 +13,7 @@ public enum MediaPermissionAudio AllAudio } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public enum MediaPermissionVideo @@ -24,7 +24,7 @@ public enum MediaPermissionVideo AllVideo, } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public enum MediaPermissionImage @@ -35,7 +35,7 @@ public enum MediaPermissionImage AllImage, } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class MediaPermission : CodeAccessPermission, IUnrestrictedPermission @@ -61,7 +61,7 @@ public override void FromXml(SecurityElement securityElement) { } public MediaPermissionImage Image { get { return MediaPermissionImage.AllImage; } } } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PermissionSetAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PermissionSetAttribute.cs index c36c4cbc73bd98..6bfe07a081b8e2 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PermissionSetAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PermissionSetAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermission.cs index 060fd7b4f06794..aebdfcfbe66185 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermission.cs @@ -8,7 +8,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class PrincipalPermission : IPermission, ISecurityEncodable, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermissionAttribute.cs index b8a3ff91e7b4e3..14a620670ec878 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermissionAttribute.cs @@ -3,13 +3,13 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(68), AllowMultiple = true, Inherited = false)] public sealed partial class PrincipalPermissionAttribute : CodeAccessSecurityAttribute { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.PrincipalPermissionAttributeMessage, error: true, DiagnosticId = Obsoletions.PrincipalPermissionAttributeDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public PrincipalPermissionAttribute(SecurityAction action) : base(default(SecurityAction)) { } diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermission.cs index b0faace69f7ecd..1c326f70458146 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermission.cs @@ -5,7 +5,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class PublisherIdentityPermission : CodeAccessPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermissionAttribute.cs index d8ce7f50636b88..567d880bfdc8cb 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermission.cs index d6577df8242439..153550aa2a74be 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class ReflectionPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionAttribute.cs index aeec90580dccd7..f6762fe4944bbc 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionFlag.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionFlag.cs index 1c9e39eb6b3d7f..14d809eee162e2 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionFlag.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionFlag.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Flags] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermission.cs index 04fa83df808422..03cefc8f6ae055 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermission.cs @@ -5,7 +5,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class RegistryPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAccess.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAccess.cs index b2f0384acdc1d3..2f50d5d5fecd65 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAccess.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAccess.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Flags] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAttribute.cs index da29af354dc307..9c4495a8ea3b18 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBase.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBase.cs index 597647caf26d87..4297b80a495567 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBase.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBase.cs @@ -5,7 +5,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public abstract class ResourcePermissionBase : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBaseEntry.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBaseEntry.cs index 77c012439029b6..ade10e2674c7a3 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBaseEntry.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBaseEntry.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public class ResourcePermissionBaseEntry diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SecurityPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SecurityPermission.cs index a1aa39a9764f73..5df48d3d440f9e 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SecurityPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SecurityPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class SecurityPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermission.cs index 160a9301aed394..d1296b7bd7e4b5 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class SiteIdentityPermission : CodeAccessPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermissionAttribute.cs index 9110f6b74f7402..da1eacf54f7688 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermission.cs index 691439b51dd580..07a2ea11dbe4a6 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class StorePermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionAttribute.cs index c3c50ebf60afe5..8614491c3d21d2 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionFlags.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionFlags.cs index 283e66a697f7c5..13b271e49dc847 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionFlags.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionFlags.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Flags] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermission.cs index 1d66fa2f7e48ac..2fd19c8447fd3d 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class StrongNameIdentityPermission : CodeAccessPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermissionAttribute.cs index 07b3014ec9a7fb..7863adc97853a8 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs index 44b39f9c8ad986..513e5e04b21cb2 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class StrongNamePublicKeyBlob diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermission.cs index d1e18e0a81069e..8ba9f50cdb8aa9 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class TypeDescriptorPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionAttribute.cs index 767a40af5103d2..708244fba8b5ce 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionFlags.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionFlags.cs index b8c76becc953b8..ad40546c57cefc 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionFlags.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionFlags.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [Flags] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermission.cs index a325753b611342..95e3fadeea8b4b 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class UIPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionAttribute.cs index f5569f8af056c0..8de20804274028 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionClipboard.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionClipboard.cs index cbe563a8ecffb8..7739ac11bd19e6 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionClipboard.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionClipboard.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public enum UIPermissionClipboard diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionWindow.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionWindow.cs index c87c0b8dfdf661..766027238938e0 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionWindow.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionWindow.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public enum UIPermissionWindow diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermission.cs index 1ddc1172e27372..7a74ef52fcd150 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class UrlIdentityPermission : CodeAccessPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermissionAttribute.cs index 49ce74de84e48d..cda8134abe7f60 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/WebBrowserPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/WebBrowserPermission.cs index 3f0670d9fa276a..c4ac4a3fb126f3 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/WebBrowserPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/WebBrowserPermission.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public enum WebBrowserPermissionLevel @@ -12,7 +12,7 @@ public enum WebBrowserPermissionLevel Unrestricted } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class WebBrowserPermission : CodeAccessPermission, IUnrestrictedPermission @@ -30,7 +30,7 @@ public override void FromXml(SecurityElement securityElement) { } public WebBrowserPermissionLevel Level { get { return WebBrowserPermissionLevel.Unrestricted; } set { } } } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermission.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermission.cs index 61e1945c22ef96..0caf076e6e585e 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermission.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class ZoneIdentityPermission : CodeAccessPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermissionAttribute.cs index 0f66c4bd431761..2833529125c59a 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermissionAttribute.cs @@ -3,7 +3,7 @@ namespace System.Security.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/ApplicationTrust.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/ApplicationTrust.cs index b17afed7b99df7..6646fe2979389f 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/ApplicationTrust.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/ApplicationTrust.cs @@ -9,14 +9,14 @@ public sealed partial class ApplicationTrust : EvidenceBase, ISecurityEncodable { public ApplicationTrust() { } public ApplicationTrust(ApplicationIdentity identity) { } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public ApplicationTrust(PermissionSet defaultGrantSet, IEnumerable fullTrustAssemblies) { } public ApplicationIdentity ApplicationIdentity { get; set; } public PolicyStatement DefaultGrantSet { get; set; } public object ExtraInfo { get; set; } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public IList FullTrustAssemblies { get { return default(IList); } } diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/FileCodeGroup.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/FileCodeGroup.cs index 599d70f03c4317..4e73e5d26f9b86 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/FileCodeGroup.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/FileCodeGroup.cs @@ -3,7 +3,7 @@ namespace System.Security.Policy { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class FileCodeGroup : CodeGroup diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/GacInstalled.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/GacInstalled.cs index f6565fbf791617..ddee079fb88dbc 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/GacInstalled.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/GacInstalled.cs @@ -3,7 +3,7 @@ namespace System.Security.Policy { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class GacInstalled : EvidenceBase, IIdentityPermissionFactory diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/IIdentityPermissionFactory.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/IIdentityPermissionFactory.cs index f519bf2c06c2da..b310bdb61d5a59 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/IIdentityPermissionFactory.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/IIdentityPermissionFactory.cs @@ -3,7 +3,7 @@ namespace System.Security.Policy { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public partial interface IIdentityPermissionFactory diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/PolicyLevel.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/PolicyLevel.cs index 74afa9599191c4..06c65039eee7ac 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/PolicyLevel.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/PolicyLevel.cs @@ -18,18 +18,18 @@ internal PolicyLevel() { } public void AddFullTrustAssembly(StrongName sn) { } [Obsolete("Because all GAC assemblies always get full trust, the full trust list is no longer meaningful. You should install any assemblies that are used in security policy in the GAC to ensure they are trusted.")] public void AddFullTrustAssembly(StrongNameMembershipCondition snMC) { } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public void AddNamedPermissionSet(NamedPermissionSet permSet) { } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public NamedPermissionSet ChangeNamedPermissionSet(string name, PermissionSet pSet) { return default(NamedPermissionSet); } [Obsolete("AppDomain policy levels are obsolete. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")] public static PolicyLevel CreateAppDomainLevel() { return default(PolicyLevel); } public void FromXml(SecurityElement e) { } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public NamedPermissionSet GetNamedPermissionSet(string name) { return default(NamedPermissionSet); } @@ -38,11 +38,11 @@ public void Recover() { } public void RemoveFullTrustAssembly(StrongName sn) { } [Obsolete("Because all GAC assemblies always get full trust, the full trust list is no longer meaningful. You should install any assemblies that are used in security policy in the GAC to ensure they are trusted.")] public void RemoveFullTrustAssembly(StrongNameMembershipCondition snMC) { } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public NamedPermissionSet RemoveNamedPermissionSet(NamedPermissionSet permSet) { return default(NamedPermissionSet); } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public NamedPermissionSet RemoveNamedPermissionSet(string name) { return default(NamedPermissionSet); } diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/PolicyStatement.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/PolicyStatement.cs index d94b4ebaec305d..7ded9666afeb99 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/PolicyStatement.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/PolicyStatement.cs @@ -5,17 +5,17 @@ namespace System.Security.Policy { public sealed partial class PolicyStatement : ISecurityEncodable, ISecurityPolicyEncodable { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public PolicyStatement(PermissionSet permSet) { } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public PolicyStatement(PermissionSet permSet, PolicyStatementAttribute attributes) { } public PolicyStatementAttribute Attributes { get; set; } public string AttributeString { get { return null; } } -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public PermissionSet PermissionSet { get; set; } diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/Publisher.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/Publisher.cs index 82d4a4c014ac61..ada8aecc2c1448 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/Publisher.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/Publisher.cs @@ -5,7 +5,7 @@ namespace System.Security.Policy { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class Publisher : EvidenceBase, IIdentityPermissionFactory diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/Site.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/Site.cs index e257cb4d44f126..885d0cdf5a37ca 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/Site.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/Site.cs @@ -3,7 +3,7 @@ namespace System.Security.Policy { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class Site : EvidenceBase, IIdentityPermissionFactory diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongName.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongName.cs index 7f9521026ed3fc..6ef2b7de49a826 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongName.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongName.cs @@ -5,7 +5,7 @@ namespace System.Security.Policy { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class StrongName : EvidenceBase, IIdentityPermissionFactory diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongNameMembershipCondition.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongNameMembershipCondition.cs index e7fa159370023c..a4fcaaa3ac2a72 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongNameMembershipCondition.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongNameMembershipCondition.cs @@ -5,7 +5,7 @@ namespace System.Security.Policy { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class StrongNameMembershipCondition : ISecurityEncodable, ISecurityPolicyEncodable, IMembershipCondition diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/Url.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/Url.cs index a108d3691fb56b..c83c904c5056c2 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/Url.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/Url.cs @@ -3,7 +3,7 @@ namespace System.Security.Policy { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class Url : EvidenceBase, IIdentityPermissionFactory diff --git a/src/libraries/System.Security.Permissions/src/System/Security/Policy/Zone.cs b/src/libraries/System.Security.Permissions/src/System/Security/Policy/Zone.cs index 2e08fd3e3a0f01..e494f429238cb8 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/Policy/Zone.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/Policy/Zone.cs @@ -3,7 +3,7 @@ namespace System.Security.Policy { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class Zone : EvidenceBase, IIdentityPermissionFactory diff --git a/src/libraries/System.Security.Permissions/src/System/Security/SecurityContext.cs b/src/libraries/System.Security.Permissions/src/System/Security/SecurityContext.cs index 1ee1b1d5e60a92..8d8756a54fb145 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/SecurityContext.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/SecurityContext.cs @@ -5,7 +5,7 @@ namespace System.Security { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed partial class SecurityContext : System.IDisposable diff --git a/src/libraries/System.Security.Permissions/src/System/Security/SecurityManager.cs b/src/libraries/System.Security.Permissions/src/System/Security/SecurityManager.cs index 0ff033c383beb9..9f02c6f3951431 100644 --- a/src/libraries/System.Security.Permissions/src/System/Security/SecurityManager.cs +++ b/src/libraries/System.Security.Permissions/src/System/Security/SecurityManager.cs @@ -6,7 +6,7 @@ namespace System.Security { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public static partial class SecurityManager diff --git a/src/libraries/System.Security.Permissions/src/System/ServiceProcess/ServiceControllerPermission.cs b/src/libraries/System.Security.Permissions/src/System/ServiceProcess/ServiceControllerPermission.cs index c049d1e6704697..af27008cee09a3 100644 --- a/src/libraries/System.Security.Permissions/src/System/ServiceProcess/ServiceControllerPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/ServiceProcess/ServiceControllerPermission.cs @@ -5,7 +5,7 @@ namespace System.ServiceProcess { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class ServiceControllerPermission : ResourcePermissionBase diff --git a/src/libraries/System.Security.Permissions/src/System/ServiceProcess/ServiceControllerPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/ServiceProcess/ServiceControllerPermissionAttribute.cs index bf7d8cbd98da3d..fea924e61bd5ce 100644 --- a/src/libraries/System.Security.Permissions/src/System/ServiceProcess/ServiceControllerPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/ServiceProcess/ServiceControllerPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.ServiceProcess { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly | AttributeTargets.Event, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Transactions/DistributedTransactionPermission.cs b/src/libraries/System.Security.Permissions/src/System/Transactions/DistributedTransactionPermission.cs index 0905e0f5b7bd23..7107e3fd7a23f4 100644 --- a/src/libraries/System.Security.Permissions/src/System/Transactions/DistributedTransactionPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Transactions/DistributedTransactionPermission.cs @@ -6,7 +6,7 @@ namespace System.Transactions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class DistributedTransactionPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Transactions/DistributedTransactionPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Transactions/DistributedTransactionPermissionAttribute.cs index cf17caabf319bf..4c794df14bee42 100644 --- a/src/libraries/System.Security.Permissions/src/System/Transactions/DistributedTransactionPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Transactions/DistributedTransactionPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Transactions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] diff --git a/src/libraries/System.Security.Permissions/src/System/Web/AspNetHostingPermission.cs b/src/libraries/System.Security.Permissions/src/System/Web/AspNetHostingPermission.cs index 74b2a712674cb5..9735b517fe4f90 100644 --- a/src/libraries/System.Security.Permissions/src/System/Web/AspNetHostingPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Web/AspNetHostingPermission.cs @@ -6,7 +6,7 @@ namespace System.Web { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class AspNetHostingPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.Security.Permissions/src/System/Web/AspNetHostingPermissionAttribute.cs b/src/libraries/System.Security.Permissions/src/System/Web/AspNetHostingPermissionAttribute.cs index d5c8631f21623a..9b91e5a31dc784 100644 --- a/src/libraries/System.Security.Permissions/src/System/Web/AspNetHostingPermissionAttribute.cs +++ b/src/libraries/System.Security.Permissions/src/System/Web/AspNetHostingPermissionAttribute.cs @@ -6,7 +6,7 @@ namespace System.Web { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] diff --git a/src/libraries/System.Security.Permissions/src/System/Xaml/Permissions/XamlLoadPermission.cs b/src/libraries/System.Security.Permissions/src/System/Xaml/Permissions/XamlLoadPermission.cs index e5b1f021d1c734..5ce3a929edeb7e 100644 --- a/src/libraries/System.Security.Permissions/src/System/Xaml/Permissions/XamlLoadPermission.cs +++ b/src/libraries/System.Security.Permissions/src/System/Xaml/Permissions/XamlLoadPermission.cs @@ -10,7 +10,7 @@ namespace System.Xaml.Permissions { -#if NETCOREAPP +#if NET [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] #endif public sealed class XamlLoadPermission : CodeAccessPermission, IUnrestrictedPermission diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/DateTimeHelper.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/DateTimeHelper.cs index ee0bb46bdfb161..b9b6cada89d568 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/DateTimeHelper.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/DateTimeHelper.cs @@ -58,7 +58,7 @@ private static bool Rfc3339DateTimeParser(string dateTimeString, out DateTimeOff ++i; } -#if NETCOREAPP +#if NET dateTimeString = string.Concat(dateTimeString.AsSpan(0, 19), dateTimeString.AsSpan(i)); #else dateTimeString = dateTimeString.Substring(0, 19) + dateTimeString.Substring(i); diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs index dc3a9d931f13e3..fa6be7f42e7403 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs @@ -73,7 +73,7 @@ public unsafe void RequestAdditionalTime(int milliseconds) } } -#if NETCOREAPP +#if NET /// /// When this method is called from OnStart, OnStop, OnPause or OnContinue, /// the specified wait hint is passed to the diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs index 2892e1abebe46f..3041721ecaa6a0 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs @@ -934,7 +934,7 @@ public void Stop() /// /// true to stop all running dependent services together with the service; false to stop only the service. /// -#if NETCOREAPP +#if NET public #else private diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/SessionChangeDescription.cs b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/SessionChangeDescription.cs index e4924e93c414e5..0503b80316e893 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/SessionChangeDescription.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/SessionChangeDescription.cs @@ -6,7 +6,7 @@ namespace System.ServiceProcess { public readonly struct SessionChangeDescription -#if NETCOREAPP +#if NET : IEquatable #endif { diff --git a/src/libraries/System.ServiceProcess.ServiceController/tests/ServiceBaseTests.cs b/src/libraries/System.ServiceProcess.ServiceController/tests/ServiceBaseTests.cs index 2d097c766c3322..f0b49f902fa838 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/tests/ServiceBaseTests.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/tests/ServiceBaseTests.cs @@ -70,7 +70,7 @@ private void Cleanup() } } -#if NETCOREAPP +#if NET [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsPrivilegedProcess))] [InlineData(-2)] [InlineData((long)int.MaxValue + 1)] diff --git a/src/libraries/System.Text.Encodings.Web/src/System/IO/TextWriterExtensions.cs b/src/libraries/System.Text.Encodings.Web/src/System/IO/TextWriterExtensions.cs index bcb3cb0bd77830..11bff860545bd3 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/IO/TextWriterExtensions.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/IO/TextWriterExtensions.cs @@ -3,7 +3,7 @@ using System.Diagnostics; -#if !NETCOREAPP +#if !NET using System.Buffers; #endif @@ -29,7 +29,7 @@ public static void WritePartialString(this TextWriter writer, string value, int // if slicing is required, call TextWriter.Write(ROS) if available; // otherwise rent an array and implement the Write routine ourselves ReadOnlySpan sliced = value.AsSpan(offset, count); -#if NETCOREAPP +#if NET writer.Write(sliced); #else char[] rented = ArrayPool.Shared.Rent(sliced.Length); diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/AllowedBmpCodePointsBitmap.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/AllowedBmpCodePointsBitmap.cs index 377d1d0c071d45..d989b7c267e78d 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/AllowedBmpCodePointsBitmap.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/AllowedBmpCodePointsBitmap.cs @@ -6,7 +6,7 @@ using System.Runtime.CompilerServices; using System.Text.Unicode; -#if NETCOREAPP +#if NET using System.Numerics; #endif @@ -69,7 +69,7 @@ public void ForbidUndefinedCharacters() Span thisAllowedCharactersBitmap = new Span(pBitmap, BitmapLengthInDWords); Debug.Assert(definedCharsBitmapAsLittleEndian.Length == thisAllowedCharactersBitmap.Length * sizeof(uint)); -#if NETCOREAPP +#if NET if (Vector.IsHardwareAccelerated && BitConverter.IsLittleEndian) { while (!definedCharsBitmapAsLittleEndian.IsEmpty) diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.Ascii.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.Ascii.cs index 03c0e7fc324bfd..d2aac7f94f4cfb 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.Ascii.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.Ascii.cs @@ -5,7 +5,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -#if NETCOREAPP +#if NET using System.Runtime.Intrinsics; #endif @@ -22,7 +22,7 @@ private unsafe partial struct AllowedAsciiCodePoints [FieldOffset(0)] // ensure same offset with AsVector field private fixed byte AsBytes[16]; -#if NETCOREAPP +#if NET #if !TARGET_BROWSER [FieldOffset(0)] // ensure same offset with AsBytes field internal Vector128 AsVector; diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.cs index 56fc2b77a93872..e3f12a3b2a84de 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.cs @@ -5,11 +5,11 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -#if NETCOREAPP +#if NET using System.Runtime.Intrinsics.X86; #endif -#if NETCOREAPP +#if NET using System.Runtime.Intrinsics.Arm; #endif @@ -347,7 +347,7 @@ public int GetIndexOfFirstByteToEncode(ReadOnlySpan data) int dataOriginalLength = data.Length; -#if NETCOREAPP +#if NET if (Ssse3.IsSupported || (AdvSimd.Arm64.IsSupported && BitConverter.IsLittleEndian)) { int asciiBytesSkipped; @@ -416,7 +416,7 @@ public unsafe int GetIndexOfFirstCharToEncode(ReadOnlySpan data) // The SIMD-enabled version handles only ASCII characters. nuint idx = 0; -#if NETCOREAPP +#if NET if (Ssse3.IsSupported) { idx = GetIndexOfFirstCharToEncodeSsse3(pData, lengthInChars); diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs index 41b620e1beec02..4c9aee5292948a 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs @@ -150,7 +150,7 @@ private string EncodeToNewString(ReadOnlySpan value, int indexOfFirstCharT ReadOnlySpan remainingInput = value.Slice(indexOfFirstCharToEncode); ValueStringBuilder stringBuilder = new ValueStringBuilder(stackalloc char[EncodeStartingOutputBufferSize]); -#if !NETCOREAPP +#if !NET // Can't call string.Concat later in the method, so memcpy now. stringBuilder.Append(value.Slice(0, indexOfFirstCharToEncode)); #endif @@ -175,7 +175,7 @@ private string EncodeToNewString(ReadOnlySpan value, int indexOfFirstCharT stringBuilder.Length -= destBuffer.Length - charsWrittenJustNow; } while (!remainingInput.IsEmpty); -#if NETCOREAPP +#if NET string retVal = string.Concat(value.Slice(0, indexOfFirstCharToEncode), stringBuilder.AsSpan()); stringBuilder.Dispose(); return retVal; diff --git a/src/libraries/System.Text.Json/Common/JsonCamelCaseNamingPolicy.cs b/src/libraries/System.Text.Json/Common/JsonCamelCaseNamingPolicy.cs index 436489906a6250..43fa642a3c6d2d 100644 --- a/src/libraries/System.Text.Json/Common/JsonCamelCaseNamingPolicy.cs +++ b/src/libraries/System.Text.Json/Common/JsonCamelCaseNamingPolicy.cs @@ -12,7 +12,7 @@ public override string ConvertName(string name) return name; } -#if NETCOREAPP +#if NET return string.Create(name.Length, name, (chars, name) => { name.CopyTo(chars); diff --git a/src/libraries/System.Text.Json/Common/JsonHelpers.cs b/src/libraries/System.Text.Json/Common/JsonHelpers.cs index afa3afb4dc2ce4..ad718eba4a41fe 100644 --- a/src/libraries/System.Text.Json/Common/JsonHelpers.cs +++ b/src/libraries/System.Text.Json/Common/JsonHelpers.cs @@ -11,7 +11,7 @@ namespace System.Text.Json { internal static partial class JsonHelpers { -#if !NETCOREAPP +#if !NET /// /// netstandard/netfx polyfill for Dictionary.TryAdd /// diff --git a/src/libraries/System.Text.Json/src/System/ReflectionExtensions.cs b/src/libraries/System.Text.Json/src/System/ReflectionExtensions.cs index 9dab389dd045a0..ec6b46db24e877 100644 --- a/src/libraries/System.Text.Json/src/System/ReflectionExtensions.cs +++ b/src/libraries/System.Text.Json/src/System/ReflectionExtensions.cs @@ -97,7 +97,7 @@ private static bool HasCustomAttributeWithName(this MemberInfo memberInfo, strin object?[] parameters) { ConstructorInfo ctorInfo = type.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, parameterTypes, null)!; -#if NETCOREAPP +#if NET return ctorInfo.Invoke(BindingFlags.DoNotWrapExceptions, null, parameters, null); #else object? result = null; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.Parse.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.Parse.cs index f9b1fffd4243b2..6bd5a2814b6460 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.Parse.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.Parse.cs @@ -833,7 +833,7 @@ private static ArraySegment ReadToEnd(Stream stream) } private static async -#if NETCOREAPP +#if NET ValueTask> #else Task> @@ -871,7 +871,7 @@ private static async Debug.Assert(rented.Length >= JsonConstants.Utf8Bom.Length); lastRead = await stream.ReadAsync( -#if NETCOREAPP +#if NET rented.AsMemory(written, utf8BomLength - written), #else rented, @@ -902,7 +902,7 @@ private static async } lastRead = await stream.ReadAsync( -#if NETCOREAPP +#if NET rented.AsMemory(written), #else rented, diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.Date.cs b/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.Date.cs index f6c6e9255d9c31..751f262acf3a34 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.Date.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/JsonHelpers.Date.cs @@ -95,7 +95,7 @@ public static bool TryParseAsISO(ReadOnlySpan source, out DateTimeOffset v return TryCreateDateTimeOffsetInterpretingDataAsLocalTime(parseData, out value); } -#if NETCOREAPP +#if NET public static bool TryParseAsIso(ReadOnlySpan source, out DateOnly value) { if (TryParseDateTimeOffset(source, out DateTimeParseData parseData) && 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 322b1d315c091e..63e2e177f49eb3 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 @@ -76,7 +76,7 @@ static bool TryAdvanceWithReadAhead(scoped ref Utf8JsonReader reader) } } -#if !NETCOREAPP +#if !NET /// /// Returns if is a valid Unicode scalar /// value, i.e., is in [ U+0000..U+D7FF ], inclusive; or [ U+E000..U+10FFFF ], inclusive. @@ -165,7 +165,7 @@ public static bool TrySkipPartial(this ref Utf8JsonReader reader) /// public static string Utf8GetString(ReadOnlySpan bytes) { -#if NETCOREAPP +#if NET return Encoding.UTF8.GetString(bytes); #else if (bytes.Length == 0) @@ -191,7 +191,7 @@ public static Dictionary CreateDictionaryFromCollection comparer) where TKey : notnull { -#if !NETCOREAPP +#if !NET var dictionary = new Dictionary(comparer); foreach (KeyValuePair item in collection) @@ -207,7 +207,7 @@ public static Dictionary CreateDictionaryFromCollection= 0); path.Append('['); -#if NETCOREAPP +#if NET Span chars = stackalloc char[JsonConstants.MaximumFormatUInt32Length]; bool formatted = ((uint)index).TryFormat(chars, out int charsWritten); Debug.Assert(formatted); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderHelper.Unescaping.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderHelper.Unescaping.cs index 7408aaecc53ce0..298a59a6471739 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderHelper.Unescaping.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderHelper.Unescaping.cs @@ -210,7 +210,7 @@ public static string TranscodeHelper(ReadOnlySpan utf8Unescaped) { try { -#if NETCOREAPP +#if NET return s_utf8Encoding.GetString(utf8Unescaped); #else if (utf8Unescaped.IsEmpty) @@ -241,7 +241,7 @@ public static int TranscodeHelper(ReadOnlySpan utf8Unescaped, Span d { try { -#if NETCOREAPP +#if NET return s_utf8Encoding.GetChars(utf8Unescaped, destination); #else if (utf8Unescaped.IsEmpty) @@ -285,7 +285,7 @@ public static void ValidateUtf8(ReadOnlySpan utf8Buffer) #else try { -#if NETCOREAPP +#if NET s_utf8Encoding.GetCharCount(utf8Buffer); #else if (utf8Buffer.IsEmpty) @@ -317,7 +317,7 @@ internal static int GetUtf8ByteCount(ReadOnlySpan text) { try { -#if NETCOREAPP +#if NET return s_utf8Encoding.GetByteCount(text); #else if (text.IsEmpty) @@ -348,7 +348,7 @@ internal static int GetUtf8FromText(ReadOnlySpan text, Span dest) { try { -#if NETCOREAPP +#if NET return s_utf8Encoding.GetBytes(text, dest); #else if (text.IsEmpty) @@ -379,7 +379,7 @@ internal static int GetUtf8FromText(ReadOnlySpan text, Span dest) internal static string GetTextFromUtf8(ReadOnlySpan utf8Text) { -#if NETCOREAPP +#if NET return s_utf8Encoding.GetString(utf8Text); #else if (utf8Text.IsEmpty) @@ -528,7 +528,7 @@ private static bool TryUnescape(ReadOnlySpan source, Span destinatio + JsonConstants.UnicodePlane01StartValue; } -#if NETCOREAPP +#if NET var rune = new Rune(scalar); bool success = rune.TryEncodeToUtf8(destination.Slice(written), out int bytesWritten); #else @@ -601,7 +601,7 @@ private static bool TryUnescape(ReadOnlySpan source, Span destinatio return false; } -#if !NETCOREAPP +#if !NET /// /// Copies the UTF-8 code unit representation of this scalar to an output buffer. /// The buffer must be large enough to hold the required number of s. diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderHelper.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderHelper.cs index 9cdcc0ddfad74f..b426f61cbb31dd 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderHelper.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderHelper.cs @@ -145,7 +145,7 @@ public static bool TryGetEscapedGuid(ReadOnlySpan source, out Guid value) return false; } -#if NETCOREAPP +#if NET public static bool TryGetFloatingPointConstant(ReadOnlySpan span, out Half value) { if (span.Length == 3) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactoryHelpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactoryHelpers.cs index 622ba2cf21d19e..3d1c4ce8fce545 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactoryHelpers.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactoryHelpers.cs @@ -93,7 +93,7 @@ public static MethodInfo GetImmutableDictionaryCreateRangeMethod(this Type type, public static bool IsNonGenericStackOrQueue(this Type type) { -#if NETCOREAPP +#if NET // Optimize for linking scenarios where mscorlib is trimmed out. const string stackTypeName = "System.Collections.Stack, System.Collections.NonGeneric"; const string queueTypeName = "System.Collections.Queue, System.Collections.NonGeneric"; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/CharConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/CharConverter.cs index 82e7e2699a956e..c102a0879e1ac6 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/CharConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/CharConverter.cs @@ -36,7 +36,7 @@ public override char Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSer public override void Write(Utf8JsonWriter writer, char value, JsonSerializerOptions options) { writer.WriteStringValue( -#if NETCOREAPP +#if NET new ReadOnlySpan(in value) #else value.ToString() @@ -53,7 +53,7 @@ internal override char ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type ty internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, char value, JsonSerializerOptions options, bool isWritingExtensionDataProperty) { writer.WritePropertyName( -#if NETCOREAPP +#if NET new ReadOnlySpan(in value) #else value.ToString() diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs index 99b576030243eb..5f9ddf1eee1b62 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs @@ -61,7 +61,7 @@ public EnumConverter(EnumConverterOptions converterOptions, JsonNamingPolicy? na _nameCacheForReading = new ConcurrentDictionary(); } -#if NETCOREAPP +#if NET string[] names = Enum.GetNames(); T[] values = Enum.GetValues(); #else @@ -74,7 +74,7 @@ public EnumConverter(EnumConverterOptions converterOptions, JsonNamingPolicy? na for (int i = 0; i < names.Length; i++) { -#if NETCOREAPP +#if NET T value = values[i]; #else T value = (T)values.GetValue(i)!; @@ -106,7 +106,7 @@ public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerial return default; } -#if NETCOREAPP +#if NET if (TryParseEnumCore(ref reader, out T value)) #else string? enumString = reader.GetString(); @@ -116,7 +116,7 @@ public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerial return value; } -#if NETCOREAPP +#if NET return ReadEnumUsingNamingPolicy(reader.GetString()); #else return ReadEnumUsingNamingPolicy(enumString); @@ -270,7 +270,7 @@ public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions internal override T ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { -#if NETCOREAPP +#if NET if (TryParseEnumCore(ref reader, out T value)) #else string? enumString = reader.GetString(); @@ -280,7 +280,7 @@ internal override T ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeT return value; } -#if NETCOREAPP +#if NET return ReadEnumUsingNamingPolicy(reader.GetString()); #else return ReadEnumUsingNamingPolicy(enumString); @@ -362,14 +362,14 @@ internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, T value, J } private bool TryParseEnumCore( -#if NETCOREAPP +#if NET ref Utf8JsonReader reader, #else string? source, #endif out T value) { -#if NETCOREAPP +#if NET char[]? rentedBuffer = null; int bufferLength = reader.ValueLength; @@ -393,7 +393,7 @@ private bool TryParseEnumCore( value = default; } -#if NETCOREAPP +#if NET if (rentedBuffer != null) { charBuffer.Slice(0, charsWritten).Clear(); @@ -525,7 +525,7 @@ private static string[] SplitFlagsEnum(string value) { // todo: optimize implementation here by leveraging https://github.com/dotnet/runtime/issues/934. return value.Split( -#if NETCOREAPP +#if NET ValueSeparator #else new string[] { ValueSeparator }, StringSplitOptions.None diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/VersionConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/VersionConverter.cs index c3e60ab0448d34..85e0d8f67398a4 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/VersionConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/VersionConverter.cs @@ -7,7 +7,7 @@ namespace System.Text.Json.Serialization.Converters { internal sealed class VersionConverter : JsonPrimitiveConverter { -#if NETCOREAPP +#if NET private const int MinimumVersionLength = 3; // 0.0 private const int MaximumVersionLength = 43; // 2147483647.2147483647.2147483647.2147483647 @@ -34,7 +34,7 @@ private static Version ReadCore(ref Utf8JsonReader reader) { Debug.Assert(reader.TokenType is JsonTokenType.PropertyName or JsonTokenType.String); -#if NETCOREAPP +#if NET if (!JsonHelpers.IsInRangeInclusive(reader.ValueLength, MinimumVersionLength, MaximumEscapedVersionLength)) { ThrowHelper.ThrowFormatException(DataType.Version); @@ -84,7 +84,7 @@ public override void Write(Utf8JsonWriter writer, Version? value, JsonSerializer return; } -#if NETCOREAPP +#if NET #if NET8_0_OR_GREATER Span span = stackalloc byte[MaximumVersionLength]; #else @@ -110,7 +110,7 @@ internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, Version va ThrowHelper.ThrowArgumentNullException(nameof(value)); } -#if NETCOREAPP +#if NET #if NET8_0_OR_GREATER Span span = stackalloc byte[MaximumVersionLength]; #else diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs index 469abaae498d25..cf8b87696ea713 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs @@ -214,7 +214,7 @@ internal bool TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSeriali bool success; if ( -#if NETCOREAPP +#if NET !typeof(T).IsValueType && #endif CanBePolymorphic) @@ -367,7 +367,7 @@ internal bool TryWrite(Utf8JsonWriter writer, in T? value, JsonSerializerOptions bool success; if ( -#if NETCOREAPP +#if NET // Short-circuit the check against "is not null"; treated as a constant by recent versions of the JIT. !typeof(T).IsValueType && #else diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs index c8fd040736dbb9..e171d8cdebe490 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs @@ -213,7 +213,7 @@ internal void ClearCaches() internal sealed class CachingContext { private readonly ConcurrentDictionary _cache = new(); -#if !NETCOREAPP +#if !NET private readonly Func _cacheEntryFactory; #endif @@ -221,7 +221,7 @@ public CachingContext(JsonSerializerOptions options, int hashCode) { Options = options; HashCode = hashCode; -#if !NETCOREAPP +#if !NET _cacheEntryFactory = type => CreateCacheEntry(type, this); #endif } @@ -254,7 +254,7 @@ public void Clear() private CacheEntry GetOrAddCacheEntry(Type type) { -#if NETCOREAPP +#if NET return _cache.GetOrAdd(type, CreateCacheEntry, this); #else return _cache.GetOrAdd(type, _cacheEntryFactory); @@ -605,7 +605,7 @@ static void AddHashCode(ref HashCode hc, TValue? value) } } -#if !NETCOREAPP +#if !NET /// /// Polyfill for System.HashCode. /// diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Converters.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Converters.cs index b5bb76c77b0652..c96e2a1c8f5da5 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Converters.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Converters.cs @@ -51,7 +51,7 @@ private static Dictionary GetDefaultSimpleConverters() Add(JsonMetadataServices.CharConverter); Add(JsonMetadataServices.DateTimeConverter); Add(JsonMetadataServices.DateTimeOffsetConverter); -#if NETCOREAPP +#if NET Add(JsonMetadataServices.DateOnlyConverter); Add(JsonMetadataServices.TimeOnlyConverter); Add(JsonMetadataServices.HalfConverter); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Helpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Helpers.cs index 3a39315eba51c0..3ce9c15709819a 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Helpers.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Helpers.cs @@ -23,7 +23,7 @@ internal static MemberAccessor MemberAccessor static MemberAccessor Initialize() { MemberAccessor value = -#if NETCOREAPP +#if NET // if dynamic code isn't supported, fallback to reflection RuntimeFeature.IsDynamicCodeSupported ? new ReflectionEmitCachingMemberAccessor() : diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonMetadataServices.Converters.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonMetadataServices.Converters.cs index 1cf87d0c940e7a..9c6cb4b9e3ce3d 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonMetadataServices.Converters.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonMetadataServices.Converters.cs @@ -50,7 +50,7 @@ public static partial class JsonMetadataServices public static JsonConverter DateTimeOffsetConverter => s_dateTimeOffsetConverter ??= new DateTimeOffsetConverter(); private static JsonConverter? s_dateTimeOffsetConverter; -#if NETCOREAPP +#if NET /// /// Returns a instance that converts values. /// @@ -188,7 +188,7 @@ public static partial class JsonMetadataServices public static JsonConverter ObjectConverter => s_objectConverter ??= new DefaultObjectConverter(); private static JsonConverter? s_objectConverter; -#if NETCOREAPP +#if NET /// /// Returns a instance that converts values. /// diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs index e70cd8848868af..4a6f10aa440630 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs @@ -623,7 +623,7 @@ private bool NumberHandingIsApplicable() potentialNumberType == typeof(ushort) || potentialNumberType == typeof(uint) || potentialNumberType == typeof(ulong) || -#if NETCOREAPP +#if NET potentialNumberType == typeof(Half) || #endif #if NET diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfoOfT.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfoOfT.cs index 379a3754cf574f..01369330feb68f 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfoOfT.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfoOfT.cs @@ -160,7 +160,7 @@ internal override bool GetMemberAndWriteJson(object obj, ref WriteStack state, U T value = Get!(obj); if ( -#if NETCOREAPP +#if NET !typeof(T).IsValueType && // treated as a constant by recent versions of the JIT. #else !EffectiveConverter.IsValueType && diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.cs index e915c5bf4879ea..f8d5bffedc51dc 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.cs @@ -1249,7 +1249,7 @@ internal void SetCreateObjectIfCompatible(Delegate? createObject) private static bool IsByRefLike(Type type) { -#if NETCOREAPP +#if NET return type.IsByRefLike; #else if (!type.IsValueType) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.WriteHelpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.WriteHelpers.cs index d916334c1925a3..08bec6e288981b 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.WriteHelpers.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.WriteHelpers.cs @@ -36,7 +36,7 @@ internal void Serialize( writer.Flush(); } else if ( -#if NETCOREAPP +#if NET !typeof(T).IsValueType && #endif Converter.CanBePolymorphic && @@ -96,7 +96,7 @@ internal async Task SerializeAsync( await bufferWriter.WriteToStreamAsync(utf8Json, cancellationToken).ConfigureAwait(false); } else if ( -#if NETCOREAPP +#if NET !typeof(T).IsValueType && #endif Converter.CanBePolymorphic && @@ -222,7 +222,7 @@ internal void Serialize( } } else if ( -#if NETCOREAPP +#if NET !typeof(T).IsValueType && #endif Converter.CanBePolymorphic && diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitCachingMemberAccessor.Cache.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitCachingMemberAccessor.Cache.cs index 8e966a122a4ffe..dc203854c3d858 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitCachingMemberAccessor.Cache.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitCachingMemberAccessor.Cache.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#if NETFRAMEWORK || NETCOREAPP +#if NETFRAMEWORK || NET using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; @@ -30,7 +30,7 @@ public TValue GetOrAdd(TKey key, Func valueFactory) where { CacheEntry entry = _cache.GetOrAdd( key, -#if NETCOREAPP +#if NET static (TKey key, Func valueFactory) => new(valueFactory(key)), valueFactory); #else diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitCachingMemberAccessor.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitCachingMemberAccessor.cs index 4efe2a3af47f12..dc18286f7e1270 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitCachingMemberAccessor.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitCachingMemberAccessor.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#if NETFRAMEWORK || NETCOREAPP +#if NETFRAMEWORK || NET using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Reflection; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitMemberAccessor.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitMemberAccessor.cs index 5e6f6986539e10..7bda4bda73f5eb 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitMemberAccessor.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitMemberAccessor.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#if NETFRAMEWORK || NETCOREAPP +#if NETFRAMEWORK || NET using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadBufferState.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadBufferState.cs index 593bb6a20dffa0..dc624235377a3f 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadBufferState.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadBufferState.cs @@ -49,7 +49,7 @@ public readonly async ValueTask ReadFromStreamAsync( do { int bytesRead = await utf8Json.ReadAsync( -#if NETCOREAPP +#if NET bufferState._buffer.AsMemory(bufferState._count), #else bufferState._buffer, bufferState._count, bufferState._buffer.Length - bufferState._count, @@ -80,7 +80,7 @@ public void ReadFromStream(Stream utf8Json) do { int bytesRead = utf8Json.Read( -#if NETCOREAPP +#if NET _buffer.AsSpan(_count)); #else _buffer, _count, _buffer.Length - _count); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs index d183423c132325..5647005377e3f0 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs @@ -412,7 +412,7 @@ public static void ReThrowWithPath(scoped ref ReadStack state, JsonReaderExcepti string message = ex.Message; // Insert the "Path" portion before "LineNumber" and "BytePositionInLine". -#if NETCOREAPP +#if NET int iPos = message.AsSpan().LastIndexOf(" LineNumber: "); #else int iPos = message.LastIndexOf(" LineNumber: ", StringComparison.Ordinal); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.Escaping.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.Escaping.cs index 62705446f8f5d1..140ecfb9112314 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.Escaping.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.Escaping.cs @@ -6,7 +6,7 @@ using System.Diagnostics; using System.Text.Encodings.Web; -#if !NETCOREAPP +#if !NET using System.Runtime.CompilerServices; #endif @@ -42,7 +42,7 @@ internal static partial class JsonWriterHelper 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // U+00F0..U+00FF ]; -#if NETCOREAPP +#if NET private const string HexFormatString = "X4"; #endif @@ -290,7 +290,7 @@ private static void EscapeNextChars(char value, Span destination, ref int break; default: destination[written++] = 'u'; -#if NETCOREAPP +#if NET int intChar = value; intChar.TryFormat(destination.Slice(written), out int charsWritten, HexFormatString); Debug.Assert(charsWritten == 4); @@ -302,7 +302,7 @@ private static void EscapeNextChars(char value, Span destination, ref int } } -#if !NETCOREAPP +#if !NET private static int WriteHex(int value, Span destination, int written) { destination[written++] = HexConverter.ToCharUpper(value >> 12); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.cs index b5dccf9423be6d..b2e05f589fc10c 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.cs @@ -264,7 +264,7 @@ public static unsafe bool IsValidUtf8String(ReadOnlySpan bytes) #else try { -#if NETCOREAPP +#if NET s_utf8Encoding.GetCharCount(bytes); #else if (!bytes.IsEmpty) @@ -286,7 +286,7 @@ public static unsafe bool IsValidUtf8String(ReadOnlySpan bytes) internal static unsafe OperationStatus ToUtf8(ReadOnlySpan source, Span destination, out int written) { -#if NETCOREAPP +#if NET OperationStatus status = Utf8.FromUtf16(source, destination, out int charsRead, out written, replaceInvalidSequences: false, isFinalBlock: true); Debug.Assert(status is OperationStatus.Done or OperationStatus.DestinationTooSmall or OperationStatus.InvalidData); Debug.Assert(charsRead == source.Length || status is not OperationStatus.Done); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs index 03fab27688d0dc..abaa20358cf6a7 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs @@ -106,7 +106,7 @@ private static bool TryFormatDouble(double value, Span destination, out in // the .NET Core 3.0 logic of forwarding to the UTF16 formatter and transcoding it back to UTF8, // with some additional changes to remove dependencies on Span APIs which don't exist downlevel. -#if NETCOREAPP +#if NET return Utf8Formatter.TryFormat(value, destination, out bytesWritten); #else string utf16Text = value.ToString(JsonConstants.DoubleFormatString, CultureInfo.InvariantCulture); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs index 7342704d3479ae..c65c92a89c0357 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs @@ -106,7 +106,7 @@ private static bool TryFormatSingle(float value, Span destination, out int // the .NET Core 3.0 logic of forwarding to the UTF16 formatter and transcoding it back to UTF8, // with some additional changes to remove dependencies on Span APIs which don't exist downlevel. -#if NETCOREAPP +#if NET return Utf8Formatter.TryFormat(value, destination, out bytesWritten); #else string utf16Text = value.ToString(JsonConstants.SingleFormatString, CultureInfo.InvariantCulture); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs index fcf3ab2d4c2547..f357a89d5d2d04 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs @@ -8,7 +8,7 @@ using System.Threading; using System.Threading.Tasks; -#if !NETCOREAPP +#if !NET using System.Runtime.InteropServices; #endif @@ -309,7 +309,7 @@ public void Flush() _arrayBufferWriter.Advance(BytesPending); BytesPending = 0; -#if NETCOREAPP +#if NET _stream.Write(_arrayBufferWriter.WrittenSpan); #else Debug.Assert(_arrayBufferWriter.WrittenMemory.Length == _arrayBufferWriter.WrittenCount); @@ -423,7 +423,7 @@ public async Task FlushAsync(CancellationToken cancellationToken = default) _arrayBufferWriter.Advance(BytesPending); BytesPending = 0; -#if NETCOREAPP +#if NET await _stream.WriteAsync(_arrayBufferWriter.WrittenMemory, cancellationToken).ConfigureAwait(false); #else Debug.Assert(_arrayBufferWriter.WrittenMemory.Length == _arrayBufferWriter.WrittenCount); diff --git a/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Dictionary.NonStringKey.cs b/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Dictionary.NonStringKey.cs index ce8ac3d254d3ac..4d61a6f8b3091d 100644 --- a/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Dictionary.NonStringKey.cs +++ b/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Dictionary.NonStringKey.cs @@ -66,7 +66,7 @@ public static IEnumerable GetTestDictionaries() yield return WrapArgs(ushort.MaxValue, 1); yield return WrapArgs(uint.MaxValue, 1); yield return WrapArgs(ulong.MaxValue, 1); -#if NETCOREAPP +#if NET yield return WrapArgs(Half.MinValue, 1); yield return WrapArgs(Int128.MinValue, 1); yield return WrapArgs(UInt128.MaxValue, 1); @@ -340,7 +340,7 @@ public async Task TestEscapedValuesOnDeserialize(string escapedPropertyName, obj new object[] { @"\u0042\u0061\u0072\u002c\u0042\u0061\u007a", MyEnumFlags.Bar | MyEnumFlags.Baz, typeof(Dictionary) }, new object[] { @"\u002b", '+', typeof(Dictionary) }, -#if NETCOREAPP +#if NET new object[] { @"\u0033\u002e\u0031\u0032\u0035\u0065\u0034", (Half)3.125e4, typeof(Dictionary) }, new object[] { @"\u002D\u0031\u0037\u0030\u0031\u0034\u0031\u0031\u0038\u0033\u0034\u0036\u0030\u0034\u0036\u0039\u0032\u0033\u0031\u0037\u0033\u0031\u0036\u0038\u0037\u0033\u0030\u0033\u0037\u0031\u0035\u0038\u0038\u0034\u0031\u0030\u0035\u0037\u0032\u0038", diff --git a/src/libraries/System.Text.Json/tests/Common/JsonNumberTestData.cs b/src/libraries/System.Text.Json/tests/Common/JsonNumberTestData.cs index d2d2591ade5ffb..83cf29458dd063 100644 --- a/src/libraries/System.Text.Json/tests/Common/JsonNumberTestData.cs +++ b/src/libraries/System.Text.Json/tests/Common/JsonNumberTestData.cs @@ -20,7 +20,7 @@ internal class JsonNumberTestData public static List Floats { get; set; } public static List Doubles { get; set; } public static List Decimals { get; set; } -#if NETCOREAPP +#if NET public static List Int128s { get; set; } public static List UInt128s { get; set; } public static List Halfs { get; set; } @@ -37,7 +37,7 @@ internal class JsonNumberTestData public static List NullableFloats { get; set; } public static List NullableDoubles { get; set; } public static List NullableDecimals { get; set; } -#if NETCOREAPP +#if NET public static List NullableInt128s { get; set; } public static List NullableUInt128s { get; set; } public static List NullableHalfs { get; set; } @@ -247,7 +247,7 @@ static JsonNumberTestData() } #endregion -#if NETCOREAPP +#if NET #region generate Int128s Int128s = new List { @@ -381,7 +381,7 @@ static JsonNumberTestData() NullableFloats = new List(Floats.Select(num => (float?)num)); NullableDoubles = new List(Doubles.Select(num => (double?)num)); NullableDecimals = new List(Decimals.Select(num => (decimal?)num)); -#if NETCOREAPP +#if NET NullableInt128s = new List(Int128s.Select(num => (Int128?)num)); NullableUInt128s = new List(UInt128s.Select(num => (UInt128?)num)); NullableHalfs = new List(Halfs.Select(num => (Half?)num)); diff --git a/src/libraries/System.Text.Json/tests/Common/JsonTestHelper.cs b/src/libraries/System.Text.Json/tests/Common/JsonTestHelper.cs index f641a4a31290c0..8d96c4e79c432b 100644 --- a/src/libraries/System.Text.Json/tests/Common/JsonTestHelper.cs +++ b/src/libraries/System.Text.Json/tests/Common/JsonTestHelper.cs @@ -15,7 +15,7 @@ namespace System.Text.Json { internal static partial class JsonTestHelper { -#if NETCOREAPP +#if NET public const string DoubleFormatString = null; public const string SingleFormatString = null; #else @@ -23,7 +23,7 @@ internal static partial class JsonTestHelper public const string SingleFormatString = "G9"; #endif -#if NETCOREAPP +#if NET public static Half NextHalf(Random random) { double mantissa = (random.NextDouble() * 2.0) - 1.0; diff --git a/src/libraries/System.Text.Json/tests/Common/NumberHandlingTests.cs b/src/libraries/System.Text.Json/tests/Common/NumberHandlingTests.cs index 6b16a631576fa2..833b01114dc682 100644 --- a/src/libraries/System.Text.Json/tests/Common/NumberHandlingTests.cs +++ b/src/libraries/System.Text.Json/tests/Common/NumberHandlingTests.cs @@ -63,7 +63,7 @@ public async Task Number_AsRootType_RoundTrip() await RunAsRootTypeTest(JsonNumberTestData.Floats); await RunAsRootTypeTest(JsonNumberTestData.Doubles); await RunAsRootTypeTest(JsonNumberTestData.Decimals); -#if NETCOREAPP +#if NET await RunAsRootTypeTest(JsonNumberTestData.Int128s); await RunAsRootTypeTest(JsonNumberTestData.UInt128s); await RunAsRootTypeTest(JsonNumberTestData.Halfs); @@ -79,7 +79,7 @@ public async Task Number_AsRootType_RoundTrip() await RunAsRootTypeTest(JsonNumberTestData.NullableFloats); await RunAsRootTypeTest(JsonNumberTestData.NullableDoubles); await RunAsRootTypeTest(JsonNumberTestData.NullableDecimals); -#if NETCOREAPP +#if NET await RunAsRootTypeTest(JsonNumberTestData.NullableInt128s); await RunAsRootTypeTest(JsonNumberTestData.NullableUInt128s); await RunAsRootTypeTest(JsonNumberTestData.NullableHalfs); @@ -383,7 +383,7 @@ public async Task Number_AsCollectionElement_RoundTrip() await RunAsCollectionElementTest(JsonNumberTestData.Floats); await RunAsCollectionElementTest(JsonNumberTestData.Doubles); await RunAsCollectionElementTest(JsonNumberTestData.Decimals); -#if NETCOREAPP +#if NET await RunAsCollectionElementTest(JsonNumberTestData.Int128s); await RunAsCollectionElementTest(JsonNumberTestData.UInt128s); await RunAsCollectionElementTest(JsonNumberTestData.Halfs); @@ -403,7 +403,7 @@ public async Task Number_AsCollectionElement_RoundTrip() await RunAsCollectionElementTest(JsonNumberTestData.NullableFloats); await RunAsCollectionElementTest(JsonNumberTestData.NullableDoubles); await RunAsCollectionElementTest(JsonNumberTestData.NullableDecimals); -#if NETCOREAPP +#if NET await RunAsCollectionElementTest(JsonNumberTestData.NullableInt128s); await RunAsCollectionElementTest(JsonNumberTestData.NullableUInt128s); await RunAsCollectionElementTest(JsonNumberTestData.NullableHalfs); @@ -781,7 +781,7 @@ public async Task FloatingPointConstants_Pass() async Task PerformFloatingPointSerialization(string testString) { string testStringAsJson = $@"""{testString}"""; -#if NETCOREAPP +#if NET string testJson = @$"{{""HalfNumber"":{testStringAsJson},""FloatNumber"":{testStringAsJson},""DoubleNumber"":{testStringAsJson}}}"; #else string testJson = @$"{{""FloatNumber"":{testStringAsJson},""DoubleNumber"":{testStringAsJson}}}"; @@ -792,14 +792,14 @@ async Task PerformFloatingPointSerialization(string testString) { case "NaN": obj = await Serializer.DeserializeWrapper(testJson, s_optionsAllowFloatConstants); -#if NETCOREAPP +#if NET Assert.Equal(Half.NaN, obj.HalfNumber); #endif Assert.Equal(float.NaN, obj.FloatNumber); Assert.Equal(double.NaN, obj.DoubleNumber); obj = await Serializer.DeserializeWrapper(testJson, s_optionReadFromStr); -#if NETCOREAPP +#if NET Assert.Equal(Half.NaN, obj.HalfNumber); #endif Assert.Equal(float.NaN, obj.FloatNumber); @@ -807,14 +807,14 @@ async Task PerformFloatingPointSerialization(string testString) break; case "Infinity": obj = await Serializer.DeserializeWrapper(testJson, s_optionsAllowFloatConstants); -#if NETCOREAPP +#if NET Assert.Equal(Half.PositiveInfinity, obj.HalfNumber); #endif Assert.Equal(float.PositiveInfinity, obj.FloatNumber); Assert.Equal(double.PositiveInfinity, obj.DoubleNumber); obj = await Serializer.DeserializeWrapper(testJson, s_optionReadFromStr); -#if NETCOREAPP +#if NET Assert.Equal(Half.PositiveInfinity, obj.HalfNumber); #endif Assert.Equal(float.PositiveInfinity, obj.FloatNumber); @@ -822,14 +822,14 @@ async Task PerformFloatingPointSerialization(string testString) break; case "-Infinity": obj = await Serializer.DeserializeWrapper(testJson, s_optionsAllowFloatConstants); -#if NETCOREAPP +#if NET Assert.Equal(Half.NegativeInfinity, obj.HalfNumber); #endif Assert.Equal(float.NegativeInfinity, obj.FloatNumber); Assert.Equal(double.NegativeInfinity, obj.DoubleNumber); obj = await Serializer.DeserializeWrapper(testJson, s_optionReadFromStr); -#if NETCOREAPP +#if NET Assert.Equal(Half.NegativeInfinity, obj.HalfNumber); #endif Assert.Equal(float.NegativeInfinity, obj.FloatNumber); @@ -877,7 +877,7 @@ public async Task FloatingPointConstants_Fail(string testString) { string testStringAsJson = $@"""{testString}"""; string testJson; -#if NETCOREAPP +#if NET testJson = @$"{{""HalfNumber"":{testStringAsJson}}}"; await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(testJson, s_optionsAllowFloatConstants)); await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(testJson, s_optionReadFromStr)); @@ -894,7 +894,7 @@ public async Task FloatingPointConstants_Fail(string testString) [Fact] public async Task AllowFloatingPointConstants_WriteAsNumber_IfNotConstant() { -#if NETCOREAPP +#if NET Half half = (Half)1; // Not written as "1" Assert.Equal("1", await Serializer.SerializeWrapper(half, s_optionsAllowFloatConstants)); @@ -914,7 +914,7 @@ public async Task AllowFloatingPointConstants_WriteAsNumber_IfNotConstant() [InlineData("-Infinity")] public async Task Unquoted_FloatingPointConstants_Read_Fail(string testString) { -#if NETCOREAPP +#if NET await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(testString, s_optionsAllowFloatConstants)); #endif await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(testString, s_optionsAllowFloatConstants)); @@ -924,7 +924,7 @@ public async Task Unquoted_FloatingPointConstants_Read_Fail(string testString) public struct StructWithNumbers { -#if NETCOREAPP +#if NET public Half HalfNumber { get; set; } #endif public float FloatNumber { get; set; } @@ -985,7 +985,7 @@ public async Task FloatingPointConstants_IncompatibleNumber() await AssertFloatingPointIncompatible_Fails(); await AssertFloatingPointIncompatible_Fails(); await AssertFloatingPointIncompatible_Fails(); -#if NETCOREAPP +#if NET await AssertFloatingPointIncompatible_Fails(); await AssertFloatingPointIncompatible_Fails(); await AssertFloatingPointIncompatible_Fails(); @@ -1031,7 +1031,7 @@ public async Task UnsupportedFormats() await AssertUnsupportedFormatThrows(); await AssertUnsupportedFormatThrows(); await AssertUnsupportedFormatThrows(); -#if NETCOREAPP +#if NET await AssertUnsupportedFormatThrows(); await AssertUnsupportedFormatThrows(); await AssertUnsupportedFormatThrows(); @@ -1058,7 +1058,7 @@ private async Task AssertUnsupportedFormatThrows() } } -#if NETCOREAPP +#if NET [Fact] public async Task InvalidNumberFormatThrows() { @@ -1103,7 +1103,7 @@ public async Task EscapingTest() await PerformEscapingTest(JsonNumberTestData.Floats, options); await PerformEscapingTest(JsonNumberTestData.Doubles, options); await PerformEscapingTest(JsonNumberTestData.Decimals, options); -#if NETCOREAPP +#if NET await PerformEscapingTest(JsonNumberTestData.Int128s, options); await PerformEscapingTest(JsonNumberTestData.UInt128s, options); await PerformEscapingTest(JsonNumberTestData.Halfs, options); @@ -1180,7 +1180,7 @@ public async Task Number_RoundtripNull() await Perform_Number_RoundTripNull_Test(); await Perform_Number_RoundTripNull_Test(); await Perform_Number_RoundTripNull_Test(); -#if NETCOREAPP +#if NET await Perform_Number_RoundTripNull_Test(); await Perform_Number_RoundTripNull_Test(); await Perform_Number_RoundTripNull_Test(); @@ -1210,7 +1210,7 @@ public async Task NullableNumber_RoundtripNull() await Perform_NullableNumber_RoundTripNull_Test(); await Perform_NullableNumber_RoundTripNull_Test(); await Perform_NullableNumber_RoundTripNull_Test(); -#if NETCOREAPP +#if NET await Perform_NullableNumber_RoundTripNull_Test(); await Perform_NullableNumber_RoundTripNull_Test(); await Perform_NullableNumber_RoundTripNull_Test(); @@ -1243,7 +1243,7 @@ public async Task Disallow_ArbritaryStrings_On_AllowFloatingPointConstants() await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); -#if NETCOREAPP +#if NET await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); @@ -1259,7 +1259,7 @@ public async Task Disallow_ArbritaryStrings_On_AllowFloatingPointConstants() await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); -#if NETCOREAPP +#if NET await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); await Assert.ThrowsAsync(async () => await Serializer.DeserializeWrapper(json, s_optionsAllowFloatConstants)); diff --git a/src/libraries/System.Text.Json/tests/Common/Utf8MemoryStream.cs b/src/libraries/System.Text.Json/tests/Common/Utf8MemoryStream.cs index 2904d744aa949a..c28b5bb6c1127b 100644 --- a/src/libraries/System.Text.Json/tests/Common/Utf8MemoryStream.cs +++ b/src/libraries/System.Text.Json/tests/Common/Utf8MemoryStream.cs @@ -20,7 +20,7 @@ public Utf8MemoryStream(string text) : base(Encoding.UTF8.GetBytes(text)) { } -#if NETCOREAPP +#if NET public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) => base.WriteAsync(buffer, _ignoreCancellationTokenOnWriteAsync ? default : cancellationToken); #endif diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs index 182981002b742b..a26c22e1dde2c6 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs @@ -38,7 +38,7 @@ public interface ITestContext public JsonTypeInfo JsonElement { get; } public JsonTypeInfo ClassWithEnumAndNullable { get; } public JsonTypeInfo ClassWithNullableProperties { get; } -#if NETCOREAPP +#if NET public JsonTypeInfo ClassWithDateOnlyAndTimeOnlyValues { get; } #endif public JsonTypeInfo ClassWithCustomConverter { get; } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataAndSerializationContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataAndSerializationContextTests.cs index 308a6b8a104600..2db01d53c6eba9 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataAndSerializationContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataAndSerializationContextTests.cs @@ -34,7 +34,7 @@ namespace System.Text.Json.SourceGeneration.Tests [JsonSerializable(typeof(JsonElement))] [JsonSerializable(typeof(RealWorldContextTests.ClassWithEnumAndNullable))] [JsonSerializable(typeof(RealWorldContextTests.ClassWithNullableProperties))] -#if NETCOREAPP +#if NET [JsonSerializable(typeof(RealWorldContextTests.ClassWithDateOnlyAndTimeOnlyValues))] #endif [JsonSerializable(typeof(ClassWithCustomConverter))] diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataContextTests.cs index 10e394518cdf5e..7c99a9f7ec4bbb 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataContextTests.cs @@ -33,7 +33,7 @@ namespace System.Text.Json.SourceGeneration.Tests [JsonSerializable(typeof(JsonElement), GenerationMode = JsonSourceGenerationMode.Metadata)] [JsonSerializable(typeof(RealWorldContextTests.ClassWithEnumAndNullable), GenerationMode = JsonSourceGenerationMode.Metadata)] [JsonSerializable(typeof(RealWorldContextTests.ClassWithNullableProperties), GenerationMode = JsonSourceGenerationMode.Metadata)] -#if NETCOREAPP +#if NET [JsonSerializable(typeof(RealWorldContextTests.ClassWithDateOnlyAndTimeOnlyValues), GenerationMode = JsonSourceGenerationMode.Metadata)] #endif [JsonSerializable(typeof(ClassWithCustomConverter), GenerationMode = JsonSourceGenerationMode.Metadata)] @@ -137,7 +137,7 @@ public override void EnsureFastPathGeneratedAsExpected() [JsonSerializable(typeof(JsonElement))] [JsonSerializable(typeof(RealWorldContextTests.ClassWithEnumAndNullable))] [JsonSerializable(typeof(RealWorldContextTests.ClassWithNullableProperties))] -#if NETCOREAPP +#if NET [JsonSerializable(typeof(RealWorldContextTests.ClassWithDateOnlyAndTimeOnlyValues))] #endif [JsonSerializable(typeof(ClassWithCustomConverter))] diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MixedModeContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MixedModeContextTests.cs index 529bd598b6ea25..d2ef2350092be6 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MixedModeContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MixedModeContextTests.cs @@ -34,7 +34,7 @@ namespace System.Text.Json.SourceGeneration.Tests [JsonSerializable(typeof(JsonElement), GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(RealWorldContextTests.ClassWithEnumAndNullable), GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(RealWorldContextTests.ClassWithNullableProperties), GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] -#if NETCOREAPP +#if NET [JsonSerializable(typeof(RealWorldContextTests.ClassWithDateOnlyAndTimeOnlyValues), GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] #endif [JsonSerializable(typeof(ClassWithCustomConverter), GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs index 00ce5d49d45131..152b716d2aaf16 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs @@ -893,7 +893,7 @@ void RunTest(ClassWithNullableProperties expected) } } -#if NETCOREAPP +#if NET [Fact] public virtual void ClassWithDateOnlyAndTimeOnlyValues_Roundtrip() { diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/NumberHandlingTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/NumberHandlingTests.cs index 0fdcf44a0e88ee..9b5ae831bc43aa 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/NumberHandlingTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/NumberHandlingTests.cs @@ -244,7 +244,7 @@ public NumberHandlingTests_Metadata() [JsonSerializable(typeof(List))] [JsonSerializable(typeof(Queue))] [JsonSerializable(typeof(ImmutableList))] -#if NETCOREAPP +#if NET [JsonSerializable(typeof(Int128))] [JsonSerializable(typeof(Int128[]))] [JsonSerializable(typeof(ConcurrentQueue))] @@ -694,7 +694,7 @@ public NumberHandlingTests_Default() [JsonSerializable(typeof(List))] [JsonSerializable(typeof(List))] [JsonSerializable(typeof(List))] -#if NETCOREAPP +#if NET [JsonSerializable(typeof(Int128))] [JsonSerializable(typeof(Int128[]))] [JsonSerializable(typeof(ConcurrentQueue))] diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationContextTests.cs index 162a8b12bd7e74..937117a84b7d1c 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationContextTests.cs @@ -35,7 +35,7 @@ namespace System.Text.Json.SourceGeneration.Tests [JsonSerializable(typeof(JsonElement))] [JsonSerializable(typeof(RealWorldContextTests.ClassWithEnumAndNullable))] [JsonSerializable(typeof(RealWorldContextTests.ClassWithNullableProperties))] -#if NETCOREAPP +#if NET [JsonSerializable(typeof(RealWorldContextTests.ClassWithDateOnlyAndTimeOnlyValues))] #endif [JsonSerializable(typeof(ClassWithCustomConverter))] @@ -88,7 +88,7 @@ internal partial class SerializationContext : JsonSerializerContext, ITestContex [JsonSerializable(typeof(JsonElement), GenerationMode = JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(RealWorldContextTests.ClassWithEnumAndNullable), GenerationMode = JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(RealWorldContextTests.ClassWithNullableProperties), GenerationMode = JsonSourceGenerationMode.Serialization)] -#if NETCOREAPP +#if NET [JsonSerializable(typeof(RealWorldContextTests.ClassWithDateOnlyAndTimeOnlyValues), GenerationMode = JsonSourceGenerationMode.Serialization)] #endif [JsonSerializable(typeof(ClassWithCustomConverter), GenerationMode = JsonSourceGenerationMode.Serialization)] @@ -144,7 +144,7 @@ internal partial class SerializationWithPerTypeAttributeContext : JsonSerializer [JsonSerializable(typeof(JsonElement), GenerationMode = JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(RealWorldContextTests.ClassWithEnumAndNullable), GenerationMode = JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(RealWorldContextTests.ClassWithNullableProperties), GenerationMode = JsonSourceGenerationMode.Serialization)] -#if NETCOREAPP +#if NET [JsonSerializable(typeof(RealWorldContextTests.ClassWithDateOnlyAndTimeOnlyValues), GenerationMode = JsonSourceGenerationMode.Serialization)] #endif [JsonSerializable(typeof(ClassWithCustomConverter), GenerationMode = JsonSourceGenerationMode.Serialization)] @@ -482,7 +482,7 @@ void RunTest(ClassWithNullableProperties expected) } } -#if NETCOREAPP +#if NET [Fact] public override void ClassWithDateOnlyAndTimeOnlyValues_Roundtrip() { diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs index 09daf5795dab24..7f56065297f171 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs @@ -46,7 +46,7 @@ public static CSharpParseOptions CreateParseOptions( documentationMode: documentationMode ?? DocumentationMode.Parse); } -#if NETCOREAPP +#if NET private static readonly Assembly systemRuntimeAssembly = Assembly.Load(new AssemblyName("System.Runtime")); #endif @@ -68,7 +68,7 @@ public static Compilation CreateCompilation( MetadataReference.CreateFromFile(typeof(GeneratedCodeAttribute).Assembly.Location), MetadataReference.CreateFromFile(typeof(ReadOnlySpan<>).Assembly.Location), MetadataReference.CreateFromFile(typeof(Console).Assembly.Location), -#if NETCOREAPP +#if NET MetadataReference.CreateFromFile(typeof(LinkedList<>).Assembly.Location), MetadataReference.CreateFromFile(systemRuntimeAssembly.Location), #else @@ -94,7 +94,7 @@ public static Compilation CreateCompilation( SyntaxTree[] syntaxTrees = new[] { CSharpSyntaxTree.ParseText(source, parseOptions), -#if !NETCOREAPP +#if !NET CSharpSyntaxTree.ParseText(NetfxPolyfillAttributes, parseOptions), #endif }; @@ -169,7 +169,7 @@ public static byte[] CreateAssemblyImage(Compilation compilation) return ms.ToArray(); } -#if !NETCOREAPP +#if !NET private const string NetfxPolyfillAttributes = """ namespace System.Runtime.CompilerServices { diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs index e2f08b988441c0..0143e7dd1c4154 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs @@ -711,7 +711,7 @@ public class NestedGenericClass [InlineData("public ref partial struct MyGenericRefStruct")] [InlineData("public readonly partial struct MyReadOnlyStruct")] [InlineData("public readonly ref partial struct MyReadOnlyRefStruct")] -#if ROSLYN4_0_OR_GREATER && NETCOREAPP +#if ROSLYN4_0_OR_GREATER && NET [InlineData("public partial record MyRecord(int x)", LanguageVersion.CSharp10)] [InlineData("public partial record struct MyRecordStruct(int x)", LanguageVersion.CSharp10)] #endif @@ -771,7 +771,7 @@ internal partial class JsonContext : JsonSerializerContext CompilationHelper.RunJsonSourceGenerator(compilation); } -#if ROSLYN4_4_OR_GREATER && NETCOREAPP +#if ROSLYN4_4_OR_GREATER && NET [Fact] public void ShadowedMemberInitializers() { diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonTestHelper.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonTestHelper.cs index 3083d0bed99a02..adaff17da693c2 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonTestHelper.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonTestHelper.cs @@ -754,7 +754,7 @@ public static TException AssertThrows(ref Utf8JsonReader json, Asser throw ex is null ? ThrowsException.ForNoException(typeof(TException)) : ThrowsException.ForIncorrectExceptionType(typeof(TException), ex); } -#if NETCOREAPP +#if NET // This is needed due to the fact that git might normalize line endings when checking-out files public static string NormalizeLineEndings(this string value) => value.ReplaceLineEndings(); #else diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CustomConverterTests/CustomConverterTests.Dynamic.Sample.Tests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CustomConverterTests/CustomConverterTests.Dynamic.Sample.Tests.cs index 69c53e91e37d37..3eef5a856aee20 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CustomConverterTests/CustomConverterTests.Dynamic.Sample.Tests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CustomConverterTests/CustomConverterTests.Dynamic.Sample.Tests.cs @@ -59,7 +59,7 @@ public static void VerifyPrimitives() Assert.IsType(obj); double dbl = (double)obj; -#if !NETCOREAPP +#if !NET string temp = dbl.ToString(System.Globalization.CultureInfo.InvariantCulture); // The reader uses "G17" format which causes temp to be 4.2000000000000002 in this case. dbl = double.Parse(temp, System.Globalization.CultureInfo.InvariantCulture); diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Value.ReadTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Value.ReadTests.cs index 437acca92b09b2..b080c282911e22 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Value.ReadTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Value.ReadTests.cs @@ -391,7 +391,7 @@ public static void ReadPrimitiveUri() private static int SingleToInt32Bits(float value) { -#if NETCOREAPP +#if NET return BitConverter.SingleToInt32Bits(value); #else return Unsafe.As(ref value); @@ -470,7 +470,7 @@ private static void DeserializeLongJsonString(int stringLength) string json; char fillChar = 'x'; -#if NETCOREAPP +#if NET json = string.Create(stringLength, fillChar, (chars, fillChar) => { chars.Fill(fillChar); @@ -566,7 +566,7 @@ public static void TimeSpan_Read_Failure(string json, bool addQuotes = true) Assert.Throws(() => JsonSerializer.Deserialize(json)); } -#if NETCOREAPP +#if NET [Theory] [InlineData("1970-01-01")] [InlineData("2002-02-13")] diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Value.WriteTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Value.WriteTests.cs index af83df3f9696d6..a59e7dc9170334 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Value.WriteTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Value.WriteTests.cs @@ -148,7 +148,7 @@ public static void TimeSpan_Write_Success(string value, string? expectedValue = Assert.Equal(json, JsonConvert.SerializeObject(ts)); } -#if NETCOREAPP +#if NET [Theory] [InlineData("1970-01-01")] [InlineData("2002-02-13")] diff --git a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs index 0a6cb3212cb2fa..486371fd3e0b76 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs +++ b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs @@ -5602,7 +5602,7 @@ private static string DescribeLoop(RegexNode node, RegexMethod rm) } private static string ToHexStringNoDashes(byte[] bytes) => -#if NETCOREAPP +#if NET Convert.ToHexString(bytes); #else BitConverter.ToString(bytes).Replace("-", ""); diff --git a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.KnownPattern.Tests.cs b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.KnownPattern.Tests.cs index 5748fd8df3c2e5..e7fe42f1cb1658 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.KnownPattern.Tests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.KnownPattern.Tests.cs @@ -1526,7 +1526,7 @@ other is not null && (Options & ~RegexOptions.Compiled) == (other.Options & ~RegexOptions.Compiled); // Compiled doesn't affect semantics, so remove it from equality for our purposes } -#if NETCOREAPP +#if NET [OuterLoop("Takes many seconds")] [Fact] public async Task PatternsDataSet_ConstructRegexForAll_NonBacktracking() diff --git a/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/ConcurrencyLimiter.cs b/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/ConcurrencyLimiter.cs index 7131b4fe1d7999..bab7263c2b1c76 100644 --- a/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/ConcurrencyLimiter.cs +++ b/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/ConcurrencyLimiter.cs @@ -434,7 +434,7 @@ public RequestRegistration(int permitCount, ConcurrencyLimiter limiter, Cancella // is going to invoke the callback synchronously, but this does not create // a deadlock because lock are reentrant if (cancellationToken.CanBeCanceled) -#if NETCOREAPP || NETSTANDARD2_1_OR_GREATER +#if NET || NETSTANDARD2_1_OR_GREATER _cancellationTokenRegistration = cancellationToken.UnsafeRegister(Cancel, this); #else _cancellationTokenRegistration = cancellationToken.Register(Cancel, this); diff --git a/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/FixedWindowRateLimiter.cs b/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/FixedWindowRateLimiter.cs index daaed9cf5ce422..7ed567f174a5f1 100644 --- a/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/FixedWindowRateLimiter.cs +++ b/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/FixedWindowRateLimiter.cs @@ -471,7 +471,7 @@ public RequestRegistration(int permitCount, FixedWindowRateLimiter limiter, Canc // is going to invoke the callback synchronously, but this does not create // a deadlock because lock are reentrant if (cancellationToken.CanBeCanceled) -#if NETCOREAPP || NETSTANDARD2_1_OR_GREATER +#if NET || NETSTANDARD2_1_OR_GREATER _cancellationTokenRegistration = cancellationToken.UnsafeRegister(Cancel, this); #else _cancellationTokenRegistration = cancellationToken.Register(Cancel, this); diff --git a/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/SlidingWindowRateLimiter.cs b/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/SlidingWindowRateLimiter.cs index 23dbf98e0fcdea..16398459a4d8a8 100644 --- a/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/SlidingWindowRateLimiter.cs +++ b/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/SlidingWindowRateLimiter.cs @@ -484,7 +484,7 @@ public RequestRegistration(int permitCount, SlidingWindowRateLimiter limiter, Ca // is going to invoke the callback synchronously, but this does not create // a deadlock because lock are reentrant if (cancellationToken.CanBeCanceled) -#if NETCOREAPP || NETSTANDARD2_1_OR_GREATER +#if NET || NETSTANDARD2_1_OR_GREATER _cancellationTokenRegistration = cancellationToken.UnsafeRegister(Cancel, this); #else _cancellationTokenRegistration = cancellationToken.Register(Cancel, this); diff --git a/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/TokenBucketRateLimiter.cs b/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/TokenBucketRateLimiter.cs index 67a3a55a29ad03..73d78efdc680de 100644 --- a/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/TokenBucketRateLimiter.cs +++ b/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/TokenBucketRateLimiter.cs @@ -485,7 +485,7 @@ public RequestRegistration(int permitCount, TokenBucketRateLimiter limiter, Canc // is going to invoke the callback synchronously, but this does not create // a deadlock because lock are reentrant if (cancellationToken.CanBeCanceled) -#if NETCOREAPP || NETSTANDARD2_1_OR_GREATER +#if NET || NETSTANDARD2_1_OR_GREATER _cancellationTokenRegistration = cancellationToken.UnsafeRegister(Cancel, this); #else _cancellationTokenRegistration = cancellationToken.Register(Cancel, this); diff --git a/src/tasks/Common/Utils.cs b/src/tasks/Common/Utils.cs index 2f2e8b2ce02d1a..1e724bf3ce2d8d 100644 --- a/src/tasks/Common/Utils.cs +++ b/src/tasks/Common/Utils.cs @@ -326,7 +326,7 @@ public static string ComputeTextIntegrity(string str) return "sha256-" + Convert.ToBase64String(hash); } -#if NETCOREAPP +#if NET public static void DirectoryCopy(string sourceDir, string destDir, Func? predicate=null) { if (!Directory.Exists(destDir)) @@ -350,7 +350,7 @@ public static void DirectoryCopy(string sourceDir, string destDir, Func(decompressedSize); #else decompressedBuffer = new byte[decompressedSize]; diff --git a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs index d48a3e6bd6e79d..a3d6df5a623482 100644 --- a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs @@ -101,7 +101,7 @@ public static bool IsWindowsIoTCore public static bool HasAssemblyFiles => !string.IsNullOrEmpty(typeof(Utilities).Assembly.Location); public static bool IsSingleFile => !HasAssemblyFiles; -#if NETCOREAPP +#if NET public static bool IsReflectionEmitSupported => RuntimeFeature.IsDynamicCodeSupported; public static bool IsNotReflectionEmitSupported => !IsReflectionEmitSupported; #else diff --git a/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcUnixDomainSocketEndPoint.cs b/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcUnixDomainSocketEndPoint.cs index f9413852a510f2..b939b4b22d15af 100644 --- a/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcUnixDomainSocketEndPoint.cs +++ b/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcUnixDomainSocketEndPoint.cs @@ -23,7 +23,7 @@ public IpcUnixDomainSocketEndPoint(string endPoint) private static EndPoint CreateEndPoint(string endPoint) { -#if NETCOREAPP +#if NET return new UnixDomainSocketEndPoint(endPoint); #elif NETSTANDARD2_0 // UnixDomainSocketEndPoint is not part of .NET Standard 2.0 diff --git a/src/tools/illink/external/Mono.Options/Options.cs b/src/tools/illink/external/Mono.Options/Options.cs index 07176081d7b3fc..d8b3d78a455096 100644 --- a/src/tools/illink/external/Mono.Options/Options.cs +++ b/src/tools/illink/external/Mono.Options/Options.cs @@ -749,7 +749,7 @@ public string OptionName { get {return this.option;} } -#if !PCL && !NETCOREAPP +#if !PCL && !NET #pragma warning disable 618 // SecurityPermissionAttribute is obsolete [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)] #pragma warning restore 618 diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/NullableAttributes.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/NullableAttributes.cs index 7ab77287ed5f31..7cf10912ea38b2 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/NullableAttributes.cs +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/NullableAttributes.cs @@ -5,7 +5,7 @@ // and updated to have the scope of the attributes be internal. namespace System.Diagnostics.CodeAnalysis { -#if !NETCOREAPP +#if !NET /// Specifies that null is allowed as an input even if the corresponding type disallows it. [AttributeUsage (AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] @@ -86,7 +86,7 @@ internal sealed class DoesNotReturnIfAttribute : Attribute #endif -#if !NETCOREAPP || NETCOREAPP3_1 +#if !NET /// Specifies that the method or property will ensure that the listed field and property members have not-null values. [AttributeUsage (AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Helpers/PlatformAssemblies.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Helpers/PlatformAssemblies.cs index c2e77e98f8d445..8638267f26acc3 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Helpers/PlatformAssemblies.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Helpers/PlatformAssemblies.cs @@ -5,7 +5,7 @@ namespace Mono.Linker.Tests.Cases.Expectations.Helpers { public static class PlatformAssemblies { -#if NETCOREAPP +#if NET public const string CoreLib = "System.Private.CoreLib.dll"; #else public const string CoreLib = "mscorlib.dll"; diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTarget.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTarget.cs index ff3d0937d56137..f0c6c8cd4deefd 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTarget.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTarget.cs @@ -10,7 +10,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { [SetupLinkerTrimMode ("link")] -#if !NETCOREAPP +#if !NET [SetupLinkerKeepDebugMembers ("true")] #endif diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInSameAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInSameAssembly.cs index 31a098588c05bf..e6da349605d78b 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInSameAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInSameAssembly.cs @@ -9,7 +9,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { [SetupLinkerTrimMode ("link")] -#if !NETCOREAPP +#if !NET [SetupLinkerKeepDebugMembers ("true")] #endif diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameOfGenericTypeInOtherAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameOfGenericTypeInOtherAssembly.cs index db44758dbb2acf..0f88184ecf3a70 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameOfGenericTypeInOtherAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameOfGenericTypeInOtherAssembly.cs @@ -10,7 +10,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { [SetupLinkerTrimMode ("link")] -#if !NETCOREAPP +#if !NET [SetupLinkerKeepDebugMembers ("true")] #endif [SetupCompileBefore ("library.dll", new[] { "../Dependencies/DebuggerDisplayAttributeOnAssemblyUsingTargetTypeNameInOtherAssembly_Lib.cs" })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnTypeThatIsNotUsed.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnTypeThatIsNotUsed.cs index af5922ed8fe707..8e65562af475ce 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnTypeThatIsNotUsed.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayAttributeOnTypeThatIsNotUsed.cs @@ -4,7 +4,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { -#if !NETCOREAPP +#if !NET [SetupLinkerKeepDebugMembers ("true")] #endif diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayOnTypeWithCallToExtensionMethodOnFieldType.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayOnTypeWithCallToExtensionMethodOnFieldType.cs index 71ed65a23c0eb2..6e13271e867904 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayOnTypeWithCallToExtensionMethodOnFieldType.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayOnTypeWithCallToExtensionMethodOnFieldType.cs @@ -7,7 +7,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { -#if !NETCOREAPP +#if !NET [SetupLinkerKeepDebugMembers ("true")] #endif public class DebuggerDisplayOnTypeWithCallToExtensionMethodOnFieldType diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayOnTypeWithCallToMethodOnFieldType.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayOnTypeWithCallToMethodOnFieldType.cs index 156bdb28e78c0f..e2fe84975f7c57 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayOnTypeWithCallToMethodOnFieldType.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes.Debugger/KeepDebugMembers/DebuggerDisplayOnTypeWithCallToMethodOnFieldType.cs @@ -4,7 +4,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.Debugger.KeepDebugMembers { -#if !NETCOREAPP +#if !NET [SetupLinkerKeepDebugMembers ("true")] #endif public class DebuggerDisplayOnTypeWithCallToMethodOnFieldType diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/CoreLibraryAssemblyAttributesAreKept.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/CoreLibraryAssemblyAttributesAreKept.cs index e4d0bf419cc3d0..d86d4bf3fbd65a 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/CoreLibraryAssemblyAttributesAreKept.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/CoreLibraryAssemblyAttributesAreKept.cs @@ -13,7 +13,7 @@ namespace Mono.Linker.Tests.Cases.Attributes [SetupLinkerArgument ("--skip-unresolved", "true")] [KeptAttributeInAssembly (PlatformAssemblies.CoreLib, typeof (AssemblyDescriptionAttribute))] [KeptAttributeInAssembly (PlatformAssemblies.CoreLib, typeof (AssemblyCompanyAttribute))] -#if !NETCOREAPP +#if !NET [KeptAttributeInAssembly ("System.dll", typeof (AssemblyDescriptionAttribute))] [KeptAttributeInAssembly ("System.dll", typeof (AssemblyCompanyAttribute))] #endif diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/CoreLibraryUnusedAssemblyAttributesAreRemoved.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/CoreLibraryUnusedAssemblyAttributesAreRemoved.cs index 64e046ec77106d..44ab4218270abb 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/CoreLibraryUnusedAssemblyAttributesAreRemoved.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/CoreLibraryUnusedAssemblyAttributesAreRemoved.cs @@ -10,7 +10,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed [SetupLinkerTrimMode ("link")] [SetupLinkerArgument ("--used-attrs-only", "true")] [RemovedAttributeInAssembly (PlatformAssemblies.CoreLib, typeof (AssemblyDescriptionAttribute))] -#if !NETCOREAPP +#if !NET [RemovedAttributeInAssembly ("System.dll", typeof (AssemblyDescriptionAttribute))] #endif public class CoreLibraryUnusedAssemblyAttributesAreRemoved diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/CoreLibraryUsedAssemblyAttributesAreKept.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/CoreLibraryUsedAssemblyAttributesAreKept.cs index bbbbe72db926d2..f3c70ec1a38dcf 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/CoreLibraryUsedAssemblyAttributesAreKept.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/CoreLibraryUsedAssemblyAttributesAreKept.cs @@ -10,7 +10,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed [SetupLinkerTrimMode ("link")] [SetupLinkerArgument ("--used-attrs-only", "true")] [KeptAttributeInAssembly (PlatformAssemblies.CoreLib, typeof (AssemblyDescriptionAttribute))] -#if !NETCOREAPP +#if !NET [KeptAttributeInAssembly ("System.dll", typeof (AssemblyDescriptionAttribute))] #endif public class CoreLibraryUsedAssemblyAttributesAreKept diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/TypeWithDynamicInterfaceCastableImplementationAttributeIsKept.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/TypeWithDynamicInterfaceCastableImplementationAttributeIsKept.cs index c6dd27cb57553a..51be76c9f7fab1 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/TypeWithDynamicInterfaceCastableImplementationAttributeIsKept.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/TypeWithDynamicInterfaceCastableImplementationAttributeIsKept.cs @@ -22,7 +22,7 @@ public class TypeWithDynamicInterfaceCastableImplementationAttributeIsKept { public static void Main () { -#if NETCOREAPP +#if NET Foo foo = new Foo (); GetBar (foo).Bar (); IReferenced baz = GetBaz (foo); @@ -32,7 +32,7 @@ public static void Main () #endif } -#if NETCOREAPP +#if NET [Kept] private static IReferencedAndCalled GetBar (object obj) { @@ -53,7 +53,7 @@ static IReferencedAssembly GetReferencedInterface (object obj) #endif } -#if NETCOREAPP +#if NET [Kept] [KeptMember (".ctor()")] [KeptInterface (typeof (IDynamicInterfaceCastable))] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.cs index e80a60f55ec2de..7c9acc549bdf53 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.cs @@ -7,7 +7,7 @@ namespace Mono.Linker.Tests.Cases.DynamicDependencies // and will be found always. // For mono though, we have to specify the assembly (Mono.Linker.Tests.Cases.Expectations) because at the time of processing // that assembly is not yet loaded into the closure in ILLink, so it won't find the attribute type. -#if NETCOREAPP +#if NET [SetupLinkAttributesFile ("DynamicDependencyFromAttributeXml.netcore.Attributes.xml")] #else [SetupLinkAttributesFile ("DynamicDependencyFromAttributeXml.mono.Attributes.xml")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXmlOnNonReferencedAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXmlOnNonReferencedAssembly.cs index f3daf2eeaf03f7..6660e84b1ec175 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXmlOnNonReferencedAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXmlOnNonReferencedAssembly.cs @@ -12,7 +12,7 @@ namespace Mono.Linker.Tests.Cases.DynamicDependencies [KeptAssembly ("field_library.dll")] [KeptMemberInAssembly ("method_library.dll", "Mono.Linker.Tests.Cases.DynamicDependencies.Dependencies.DynamicDependencyFromAttributeXmlOnNonReferencedAssemblyLibrary_Method", "Method()")] [KeptMemberInAssembly ("field_library.dll", "Mono.Linker.Tests.Cases.DynamicDependencies.Dependencies.DynamicDependencyFromAttributeXmlOnNonReferencedAssemblyLibrary_Field", "Method()")] -#if NETCOREAPP +#if NET [SetupLinkAttributesFile ("DynamicDependencyFromAttributeXmlOnNonReferencedAssembly.netcore.Attributes.xml")] #else [SetupLinkAttributesFile ("DynamicDependencyFromAttributeXmlOnNonReferencedAssembly.mono.Attributes.xml")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs index 9a8e4c4cb28cd8..3a7317444127b4 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs @@ -17,7 +17,7 @@ namespace Mono.Linker.Tests.Cases.LinkAttributes [SetupCompileBefore ("attribute.dll", new[] { "Dependencies/LinkerAttributeRemovalAttributeToRemove.cs" })] [SetupCompileBefore ("copyattribute.dll", new[] { "Dependencies/LinkerAttributeRemovalAttributeFromCopyAssembly.cs" })] [SetupLinkerAction ("copy", "copyattribute")] -#if !NETCOREAPP +#if !NET [Reference ("System.dll")] [SetupCompileBefore ("copyassembly.dll", new[] { "Dependencies/LinkerAttributeRemovalCopyAssembly.cs" }, references: new[] { "System.dll", "attribute.dll" })] #else diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/ConstructorUsedViaReflection.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/ConstructorUsedViaReflection.cs index 7ca59831a01a47..dae1731331bb13 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/ConstructorUsedViaReflection.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/ConstructorUsedViaReflection.cs @@ -16,7 +16,7 @@ public static void Main () GetConstructor_BindingAttr_Binder_Types_Modifiers.TestWithBindingFlags (); GetConstructor_BindingAttr_Binder_Types_Modifiers.TestWithUnknownBindingFlags (BindingFlags.Public); GetConstructor_BindingAttr_Binder_CallConvention_Types_Modifiers.TestWithCallingConvention (); -#if NETCOREAPP +#if NET GetConstructor_BindingAttr_Types.Test (); #endif TestNullType (); @@ -217,7 +217,7 @@ public static void TestWithCallingConvention () } } -#if NETCOREAPP +#if NET [Kept] class GetConstructor_BindingAttr_Types { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MethodUsedViaReflection.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MethodUsedViaReflection.cs index baf8860765d2dd..55e6c440fbc159 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MethodUsedViaReflection.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MethodUsedViaReflection.cs @@ -26,7 +26,7 @@ public static void Main () GetMethod_Name_BindingAttr.TestUnknownNameAndWrongBindingFlags ("Unknown"); GetMethod_Name_BindingAttr_Binder_Types_Modifiers.TestNameBindingFlagsAndParameterModifier (); GetMethod_Name_BindingAttr_Binder_CallConvention_Types_Modifiers.TestNameBindingFlagsCallingConventionParameterModifier (); -#if NETCOREAPP +#if NET GetMethod_Name_BindingAttr_Types.TestNameBindingFlagsAndTypes (); GetMethod_Name_GenericParameterCount_Types.TestNameWithIntAndType (); GetMethod_Name_GenericParameterCount_Types_Modifiers.TestNameWithIntAndTypeAndModifiers (); @@ -391,7 +391,7 @@ public static void TestNameBindingFlagsCallingConventionParameterModifier () } } -#if NETCOREAPP +#if NET // GetMethod(string name, BindingFlags bindingAttr, Type[] types) [Kept] class GetMethod_Name_BindingAttr_Types diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs index 240f365439954a..4ed5061aa4988e 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs @@ -21,7 +21,7 @@ unsafe class TypeForwardersRewrite { static void Main () { -#if NETCOREAPP +#if NET Test (null); #endif Test2 (null); @@ -56,7 +56,7 @@ static void Main () [KeptMember ("Invoke()")] delegate C D (); -#if NETCOREAPP +#if NET [Kept] static void Test (delegate* arg) { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/ComplexConditions.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/ComplexConditions.cs index ea7d62c5fb7daf..68714608fcca98 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/ComplexConditions.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/ComplexConditions.cs @@ -17,7 +17,7 @@ public static void Main () } [Kept] -#if !NETCOREAPP +#if !NET [ExpectBodyModified] #else [ExpectedInstructionSequence (new[] { @@ -50,7 +50,7 @@ static void Test_1 (object type) } [Kept] -#if !NETCOREAPP +#if !NET [ExpectBodyModified] #else [ExpectedInstructionSequence (new[] { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/SizeOfInConditions.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/SizeOfInConditions.cs index 0e0c1ef2a33556..230b7e4e9ba02b 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/SizeOfInConditions.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/SizeOfInConditions.cs @@ -4,7 +4,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock { -#if NETCOREAPP +#if NET [SetupLinkerSubstitutionFile ("SizeOfInConditions.netcore.xml")] #else [SetupLinkerSubstitutionFile ("SizeOfInConditions.net_4_x.xml")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibrary.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibrary.cs index 9c9ae70e6dc1b2..0da48a31799df5 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibrary.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibrary.cs @@ -4,7 +4,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBody { -#if NETCOREAPP +#if NET [SetupLinkerArgument ("-a", "other2.dll")] #else [SetupLinkerArgument ("-r", "other2")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibraryNoInstanceCtor.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibraryNoInstanceCtor.cs index 852c9351af12bc..9cdfe5cb72f1d3 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibraryNoInstanceCtor.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/UnreachableBody/LinkedOtherIncludedLibraryNoInstanceCtor.cs @@ -5,7 +5,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBody { [SetupLinkerArgument ("--skip-unresolved", "true")] [Define ("OTHER_INCLUDED")] -#if NETCOREAPP +#if NET [SetupLinkerArgument ("-a", "other.dll", "visible")] #else [SetupLinkerArgument ("-r", "other")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/CanGenerateWarningSuppressionFileCSharp.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/CanGenerateWarningSuppressionFileCSharp.cs index 4bb2c22213bffe..afe1832a0013db 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/CanGenerateWarningSuppressionFileCSharp.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/CanGenerateWarningSuppressionFileCSharp.cs @@ -8,7 +8,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.Individual { [SetupLinkerTrimMode ("skip")] -#if !NETCOREAPP +#if !NET [Reference ("System.Core.dll")] [SetupCompileBefore ("library.dll", new[] { typeof (TriggerWarnings_Lib) }, new[] { "System.Core.dll" })] #else diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/CanGenerateWarningSuppressionFileXml.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/CanGenerateWarningSuppressionFileXml.cs index 47d1c929435de7..e11f941e23f888 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/CanGenerateWarningSuppressionFileXml.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/CanGenerateWarningSuppressionFileXml.cs @@ -5,7 +5,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.Individual { [SetupLinkerTrimMode ("skip")] -#if !NETCOREAPP +#if !NET [SetupCompileBefore ("library.dll", new[] { typeof (TriggerWarnings_Lib) }, new[] { "System.Core.dll" })] #else [SetupCompileBefore ("library.dll", new[] { typeof (TriggerWarnings_Lib) })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/WarningsAreSorted.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/WarningsAreSorted.cs index c39f6a9028ce53..10cd9d58982d77 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/WarningsAreSorted.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/Individual/WarningsAreSorted.cs @@ -12,7 +12,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.Individual { [SkipRemainingErrorsValidation] [SetupLinkerTrimMode ("skip")] -#if !NETCOREAPP +#if !NET [SetupCompileBefore ("library.dll", new[] { typeof (TriggerWarnings_Lib) }, new[] { "System.Core.dll" })] #else [SetupCompileBefore ("library.dll", new[] { typeof (TriggerWarnings_Lib) })] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInAssembly.cs index c9e88bdf6a729c..63b0c109c17987 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInAssembly.cs @@ -7,7 +7,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression { -#if !NETCOREAPP +#if !NET [Mono.Linker.Tests.Cases.Expectations.Metadata.Reference ("System.Core.dll")] #endif [SkipKeptItemsValidation] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInCopyAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInCopyAssembly.cs index a4e0082b3b5ef6..8985bc61897541 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInCopyAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInCopyAssembly.cs @@ -7,7 +7,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression { -#if !NETCOREAPP +#if !NET [Reference ("System.Core.dll")] #endif [SetupLinkerAction ("copy", "test")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInMembersAndTypes.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInMembersAndTypes.cs index 596b7d2cf62f9d..8287c0caddb7ee 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInMembersAndTypes.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInMembersAndTypes.cs @@ -6,7 +6,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression { -#if !NETCOREAPP +#if !NET [Mono.Linker.Tests.Cases.Expectations.Metadata.Reference ("System.Core.dll")] #endif [SkipKeptItemsValidation] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInMembersAndTypesUsingTarget.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInMembersAndTypesUsingTarget.cs index a0121281c2494f..d00ac7d68fb484 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInMembersAndTypesUsingTarget.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInMembersAndTypesUsingTarget.cs @@ -12,7 +12,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression { -#if !NETCOREAPP +#if !NET [Mono.Linker.Tests.Cases.Expectations.Metadata.Reference ("System.Core.dll")] #endif [SkipKeptItemsValidation] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInModule.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInModule.cs index 8273e453bc8f1b..9906cecac482cb 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInModule.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/SuppressWarningsInModule.cs @@ -9,7 +9,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression { -#if !NETCOREAPP +#if !NET [Mono.Linker.Tests.Cases.Expectations.Metadata.Reference ("System.Core.dll")] #endif [SkipKeptItemsValidation] diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCases/TestSuites.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCases/TestSuites.cs index fd25f5cc8cef97..a05e68b17bd468 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCases/TestSuites.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCases/TestSuites.cs @@ -52,7 +52,7 @@ public void CodegenAnnotationTests (TestCase testCase) if (Environment.OSVersion.Platform == PlatformID.Win32NT) Assert.Ignore ("These tests are not valid when trimming .NET Framework"); -#if NETCOREAPP +#if NET Assert.Ignore ("These tests are not valid when trimming .NET Core"); #endif Run (testCase); diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ILCompiler.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ILCompiler.cs index 7b5835d2b0fc4f..bff5b87a995088 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ILCompiler.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ILCompiler.cs @@ -49,7 +49,7 @@ protected virtual void SetupProcess (Process process, CompilerOptions options) private static string BuildArguments (CompilerOptions options) { var args = new StringBuilder (); -#if NETCOREAPP +#if NET args.Append (options.OutputPath.ExtensionWithDot == ".dll" ? "-dll" : "-exe"); args.Append ($" -out:{options.OutputPath.InQuotes ()}"); #else @@ -62,7 +62,7 @@ private static string BuildArguments (CompilerOptions options) protected virtual NPath LocateIlasm () { -#if NETCOREAPP +#if NET var extension = RuntimeInformation.IsOSPlatform (OSPlatform.Windows) ? ".exe" : ""; var toolsDir = (string)AppContext.GetData("Mono.Linker.Tests.ILToolsDir")!; diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs index c26e833d9e9f3a..fe25e06dd2c7a1 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs @@ -76,7 +76,7 @@ public virtual IEnumerable GetDefines () yield return "WIN32"; if (Characteristics.HasFlag (TestRunCharacteristics.TargetingNetCore)) - yield return "NETCOREAPP"; + yield return "NET"; if (Characteristics.HasFlag (TestRunCharacteristics.SupportsDefaultInterfaceMethods)) yield return "SUPPORTS_DEFAULT_INTERFACE_METHODS"; diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs index ec427ebdbc4858..89c202e472c05a 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs @@ -9,7 +9,7 @@ using System.Text; using Mono.Linker.Tests.Extensions; using NUnit.Framework; -#if NETCOREAPP +#if NET using System.Runtime.InteropServices; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Emit; @@ -190,7 +190,7 @@ protected static NPath MakeSupportingAssemblyReferencePathAbsolute (NPath output if (Path.IsPathRooted (referenceFileName)) return referenceFileName.ToNPath (); -#if NETCOREAPP +#if NET if (referenceFileName.StartsWith ("System.", StringComparison.Ordinal) || referenceFileName.StartsWith ("Mono.", StringComparison.Ordinal) || referenceFileName.StartsWith ("Microsoft.", StringComparison.Ordinal) || @@ -224,14 +224,14 @@ protected NPath CompileAssembly (CompilerOptions options) protected virtual NPath CompileCSharpAssemblyWithDefaultCompiler (CompilerOptions options) { -#if NETCOREAPP +#if NET return CompileCSharpAssemblyWithRoslyn (options); #else return CompileCSharpAssemblyWithCsc (options); #endif } -#if NETCOREAPP +#if NET protected virtual NPath CompileCSharpAssemblyWithRoslyn (CompilerOptions options) { var languageVersion = LanguageVersion.Preview; @@ -328,7 +328,7 @@ protected virtual NPath CompileCSharpAssemblyWithRoslyn (CompilerOptions options protected virtual NPath CompileCSharpAssemblyWithCsc (CompilerOptions options) { -#if NETCOREAPP +#if NET return CompileCSharpAssemblyWithRoslyn (options); #else return CompileCSharpAssemblyWithExternalCompiler (LocateCscExecutable (), options, "/shared "); diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs index cdb59e6571130d..8789c404839b48 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs @@ -66,7 +66,7 @@ public virtual void RootAssemblyEntryPoint (string fileName) public virtual void RootAssemblyVisible (string fileName) { -#if NETCOREAPP +#if NET Append ("-a"); Append (fileName); Append ("visible"); @@ -213,7 +213,7 @@ public virtual void ProcessOptions (TestCaseLinkerOptions options) IgnoreLinkAttributes (options.IgnoreLinkAttributes); -#if !NETCOREAPP +#if !NET if (!string.IsNullOrEmpty (options.Il8n)) AddIl8n (options.Il8n); #endif