Mark Obsoletions for .NET 5 (#39269)
authorJeff Handley <jeffhandley@users.noreply.github.com>
Sat, 18 Jul 2020 00:09:29 +0000 (17:09 -0700)
committerGitHub <noreply@github.com>
Sat, 18 Jul 2020 00:09:29 +0000 (17:09 -0700)
* Mark new obsoletions for .NET 5; update existing obsoletions

* Exclude DirectoryServicesPermission/DirectoryServicesPermissionAttribute from obsoletions for now

* No need to restore SYSLIB0003 at end of Forwards files

* Use a common Obsoletions.cs file for all SYSLIB obsoletions

* Resurrect CER code behind #ifdef in EventSource

* Mark GlobalAssemblyCache overrides as Obsolete

* Suppress Thread.Abort() error in ImageAnimator.Unix.cs

* Unconditionally mark RoAssembly.GlobalAssemblyCache as obsolete

* Rename MSLIB0001 to SYSLIB0001 in ref assembly

* Suppress obsoletion warnings in tests

* Adopt a uniform #ifdef for NET50_OBSOLETIONS

* Fix BinaryFormatter obsoletion message after the rebase

* Use SYSTEM_PRIVATE_CORELIB constant instead of NETCOREAPP

* Remove the code comment on the ifdef

* Apply feedback related to CER obsoletions

* Apply feedback related to CAS

* Update ref assembly to reflect SecurityManager obsoletion

* Fix regression in System.IO.Pipes.NamedPipeServerStream.Windows.RunAsClient

195 files changed:
docs/project/list-of-obsoletions.md
src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs
src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
src/libraries/Common/src/System/Diagnostics/NetFrameworkUtils.cs
src/libraries/Common/src/System/Obsoletions.cs [new file with mode: 0644]
src/libraries/Common/tests/TestUtilities/System/Buffers/BoundedMemory.Windows.cs
src/libraries/Directory.Build.props
src/libraries/Directory.Build.targets
src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj
src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs
src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/TypeUtilTests.cs
src/libraries/System.Data.Common/src/System/Data/DataSet.cs
src/libraries/System.Data.Odbc/src/Common/System/Data/Common/AdapterUtil.Odbc.cs
src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbBuffer.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommand.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnectionHandle.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcDataReader.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcHandle.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLog.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogInternal.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs
src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryServicesPermission.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryServicesPermissionAttribute.cs
src/libraries/System.DirectoryServices/tests/System.DirectoryServices.Tests.csproj
src/libraries/System.Drawing.Common/src/System/Drawing/BufferedGraphicsManager.Windows.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Graphics.Windows.cs
src/libraries/System.Drawing.Common/src/System/Drawing/ImageAnimator.Unix.cs
src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs
src/libraries/System.IO.Ports/tests/Support/PortsTest.cs
src/libraries/System.Linq.Expressions/ref/System.Linq.Expressions.cs
src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj
src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/DebugInfoGenerator.cs
src/libraries/System.Net.Requests/ref/System.Net.Requests.cs
src/libraries/System.Net.Requests/src/System.Net.Requests.csproj
src/libraries/System.Net.Requests/src/System/Net/AuthenticationManager.cs
src/libraries/System.Net.Requests/tests/AuthenticationManagerTest.cs
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
src/libraries/System.Private.CoreLib/src/System/AppDomain.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs
src/libraries/System.Private.CoreLib/src/System/MarshalByRefObject.cs
src/libraries/System.Private.CoreLib/src/System/Obsoletions.cs [deleted file]
src/libraries/System.Private.CoreLib/src/System/Reflection/Assembly.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/ConstrainedExecution/Cer.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/ConstrainedExecution/Consistency.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/ConstrainedExecution/PrePrepareMethodAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/ConstrainedExecution/ReliabilityContractAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Security/IPermission.cs
src/libraries/System.Private.CoreLib/src/System/Security/IStackWalk.cs
src/libraries/System.Private.CoreLib/src/System/Security/PermissionSet.cs
src/libraries/System.Private.CoreLib/src/System/Security/Permissions/CodeAccessSecurityAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Security/Permissions/PermissionState.cs
src/libraries/System.Private.CoreLib/src/System/Security/Permissions/SecurityAction.cs
src/libraries/System.Private.CoreLib/src/System/Security/Permissions/SecurityAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Security/Permissions/SecurityPermissionAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Security/Permissions/SecurityPermissionFlag.cs
src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs
src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs
src/libraries/System.Reflection.Emit/ref/System.Reflection.Emit.cs
src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj
src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/MemoryMappedFileBlock.cs
src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/NativeHeapMemoryBlock.cs
src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/PinnedObject.cs
src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/VirtualHeap.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.cs
src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj
src/libraries/System.Reflection/tests/AssemblyTests.cs
src/libraries/System.Runtime.Extensions/ref/System.Runtime.Extensions.Forwards.cs
src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs
src/libraries/System.Runtime.Extensions/tests/System/MarshalByRefObjectTest.cs
src/libraries/System.Runtime.Serialization.Formatters/ref/System.Runtime.Serialization.Formatters.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatter.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.Core.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/IFormatter.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Obsoletions.cs [deleted file]
src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTestData.cs
src/libraries/System.Runtime/ref/System.Runtime.cs
src/libraries/System.Runtime/tests/System/Runtime/ConstrainedExecution/PrePrepareMethodAttributeTests.cs
src/libraries/System.Runtime/tests/System/Text/EncodingTests.cs
src/libraries/System.Security.Cryptography.Primitives/ref/System.Security.Cryptography.Primitives.cs
src/libraries/System.Security.Cryptography.Primitives/src/System.Security.Cryptography.Primitives.csproj
src/libraries/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/AsymmetricAlgorithm.cs
src/libraries/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/HMAC.cs
src/libraries/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/HashAlgorithm.cs
src/libraries/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/KeyedHashAlgorithm.cs
src/libraries/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/SymmetricAlgorithm.cs
src/libraries/System.Security.Cryptography.Primitives/tests/CryptoConfigTests.cs
src/libraries/System.Security.Permissions/ref/System.Security.Permissions.Forwards.cs
src/libraries/System.Security.Permissions/ref/System.Security.Permissions.cs
src/libraries/System.Security.Permissions/ref/System.Security.Permissions.csproj
src/libraries/System.Security.Permissions/ref/System.Security.Permissions.netcoreapp.cs
src/libraries/System.Security.Permissions/src/System.Security.Permissions.csproj
src/libraries/System.Security.Permissions/src/System/Configuration/ConfigurationPermission.cs
src/libraries/System.Security.Permissions/src/System/Data/Common/DBDataPermission.cs
src/libraries/System.Security.Permissions/src/System/Data/Odbc/OdbcPermission.cs
src/libraries/System.Security.Permissions/src/System/Data/OleDb/OleDbPermission.cs
src/libraries/System.Security.Permissions/src/System/Data/OracleClient/OraclePermission.cs
src/libraries/System.Security.Permissions/src/System/Data/SqlClient/SqlClientPermission.cs
src/libraries/System.Security.Permissions/src/System/Diagnostics/EventLogPermission.cs
src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermission.cs
src/libraries/System.Security.Permissions/src/System/Drawing/Printing/PrintingPermission.cs
src/libraries/System.Security.Permissions/src/System/Net/DnsPermission.cs
src/libraries/System.Security.Permissions/src/System/Net/Mail/SmtpPermission.cs
src/libraries/System.Security.Permissions/src/System/Net/NetworkInformation/NetworkInformationPermission.cs
src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/Collaboration/PeerCollaborationPermission.cs
src/libraries/System.Security.Permissions/src/System/Net/PeerToPeer/PnrpPermission.cs
src/libraries/System.Security.Permissions/src/System/Net/SocketPermission.cs
src/libraries/System.Security.Permissions/src/System/Net/WebPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/HostProtectionException.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/DataProtectionPermissionFlags.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAccess.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/EnvironmentPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAccess.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAccess.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/GacIdentityPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionResource.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/IUnrestrictedPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageContainment.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntry.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryCollection.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryEnumerator.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionFlags.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/MediaPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/PermissionSetAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/PrincipalPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/PublisherIdentityPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/ReflectionPermissionFlag.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAccess.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/RegistryPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBase.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBaseEntry.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/SecurityPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/SiteIdentityPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/StorePermissionFlags.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNameIdentityPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionFlags.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionClipboard.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/UIPermissionWindow.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/UrlIdentityPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/WebBrowserPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermission.cs
src/libraries/System.Security.Permissions/src/System/Security/Permissions/ZoneIdentityPermissionAttribute.cs
src/libraries/System.Security.Permissions/src/System/Security/Policy/ApplicationTrust.cs
src/libraries/System.Security.Permissions/src/System/Security/Policy/FileCodeGroup.cs
src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongName.cs
src/libraries/System.Security.Permissions/src/System/Security/Policy/StrongNameMembershipCondition.cs
src/libraries/System.Security.Permissions/src/System/Security/SecurityManager.cs
src/libraries/System.Security.Permissions/src/System/ServiceProcess/ServiceControllerPermission.cs
src/libraries/System.Security.Permissions/src/System/Transactions/DistributedTransactionPermission.cs
src/libraries/System.Security.Permissions/src/System/Web/AspNetHostingPermission.cs
src/libraries/System.Security.Permissions/src/System/Xaml/Permissions/XamlLoadPermission.cs
src/libraries/System.Security.Permissions/tests/System.Security.Permissions.Tests.csproj
src/libraries/System.Text.Encoding.Extensions/ref/System.Text.Encoding.Extensions.cs
src/libraries/System.Text.Encoding/tests/System.Text.Encoding.Tests.csproj
src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs
src/libraries/System.Threading.Thread/tests/ThreadTests.cs
src/mono/netcore/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.Mono.cs
src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs

index 6b4d3a4..3b7d669 100644 (file)
@@ -3,16 +3,24 @@ List of Obsoletions
 
 Per https://github.com/dotnet/designs/blob/master/accepted/2020/better-obsoletion/better-obsoletion.md, we now have a strategy in place for marking existing APIs as `[Obsolete]`. This takes advantage of the new diagnostic id and URL template mechanisms introduced to `ObsoleteAttribute` in .NET 5.
 
-When obsoleting an API, use the diagnostic ID `MSLIB####`, where _\#\#\#\#_ is the next four-digit identifier in the sequence, and add it to the list below. This helps us maintain a centralized location of all APIs that were obsoleted using this mechanism.
+When obsoleting an API, use the diagnostic ID `SYSLIB####`, where _\#\#\#\#_ is the next four-digit identifier in the sequence, and add it to the list below. This helps us maintain a centralized location of all APIs that were obsoleted using this mechanism.
 
 The URL template we use for obsoletions is `https://aka.ms/dotnet-warnings/{0}`.
 
-Currently the identifiers `MSLIB0001` through `MSLIB0999` are carved out for obsoletions. If we wish to introduce analyzer warnings not related to obsoletion in the future, we should begin at a different range, such as `MSLIB2000`.
+Currently the identifiers `SYSLIB0001` through `SYSLIB0999` are carved out for obsoletions. If we wish to introduce analyzer warnings not related to obsoletion in the future, we should begin at a different range, such as `SYSLIB2000`.
 
-## Current obsoletions (`MSLIB0001` - `MSLIB0999`)
+## Current obsoletions (`SYSLIB0001` - `SYSLIB0999`)
 
-| Diagnostic ID    | Description |
-| :--------------- | :---------- |
-|  __`MSLIB0001`__ | The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead. |
-|  __`MSLIB0002`__ | `PrincipalPermissionAttribute` is not honored by the runtime and must not be used. |
-|  __`MSLIB0003`__ | `BinaryFormatter` serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for recommended alternatives. |
+| Diagnostic ID     | Description |
+| :---------------- | :---------- |
+|  __`SYSLIB0001`__ | The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead. |
+|  __`SYSLIB0002`__ | PrincipalPermissionAttribute is not honored by the runtime and must not be used. |
+|  __`SYSLIB0003`__ | Code Access Security is not supported or honored by the runtime. |
+|  __`SYSLIB0004`__ | The Constrained Execution Region (CER) feature is not supported. |
+|  __`SYSLIB0005`__ | The Global Assembly Cache is not supported. |
+|  __`SYSLIB0006`__ | Thread.Abort is not supported and throws PlatformNotSupportedException. |
+|  __`SYSLIB0007`__ | The default implementation of this cryptography algorithm is not supported. |
+|  __`SYSLIB0008`__ | The CreatePdbGenerator API is not supported and throws PlatformNotSupportedException. |
+|  __`SYSLIB0009`__ | The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException. |
+|  __`SYSLIB0010`__ | This Remoting API is not supported and throws PlatformNotSupportedException. |
+|  __`SYSLIB0011`__ | `BinaryFormatter` serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for recommended alternatives. |
index b71b9ab..e1ce8a9 100644 (file)
@@ -499,6 +499,7 @@ namespace System.Reflection.Emit
             return InternalAssembly.GetReferencedAssemblies();
         }
 
+        [Obsolete(Obsoletions.GlobalAssemblyCacheMessage, DiagnosticId = Obsoletions.GlobalAssemblyCacheDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public override bool GlobalAssemblyCache => InternalAssembly.GlobalAssemblyCache;
 
         public override long HostContext => InternalAssembly.HostContext;
index 6387b7e..4aa7b48 100644 (file)
@@ -451,6 +451,7 @@ namespace System.Reflection
             }
         }
 
+        [Obsolete(Obsoletions.GlobalAssemblyCacheMessage, DiagnosticId = Obsoletions.GlobalAssemblyCacheDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public override bool GlobalAssemblyCache => false;
 
         public override long HostContext => 0;
index 1c86656..4bab9a4 100644 (file)
@@ -63,7 +63,7 @@ namespace System.Diagnostics
         private static bool SafeWaitForMutexOnce(Mutex mutexIn, ref Mutex mutexOut)
         {
             bool ret;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             { }
             finally
diff --git a/src/libraries/Common/src/System/Obsoletions.cs b/src/libraries/Common/src/System/Obsoletions.cs
new file mode 100644 (file)
index 0000000..a7c5582
--- /dev/null
@@ -0,0 +1,43 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace System
+{
+    internal static class Obsoletions
+    {
+        internal const string SharedUrlFormat = "https://aka.ms/dotnet-warnings/{0}";
+
+        internal const string SystemTextEncodingUTF7Message = "The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.";
+        internal const string SystemTextEncodingUTF7DiagId = "SYSLIB0001";
+
+        internal const string PrincipalPermissionAttributeMessage = "PrincipalPermissionAttribute is not honored by the runtime and must not be used.";
+        internal const string PrincipalPermissionAttributeDiagId = "SYSLIB0002";
+
+        internal const string CodeAccessSecurityMessage = "Code Access Security is not supported or honored by the runtime.";
+        internal const string CodeAccessSecurityDiagId = "SYSLIB0003";
+
+        internal const string ConstrainedExecutionRegionMessage = "The Constrained Execution Region (CER) feature is not supported.";
+        internal const string ConstrainedExecutionRegionDiagId = "SYSLIB0004";
+
+        internal const string GlobalAssemblyCacheMessage = "The Global Assembly Cache is not supported.";
+        internal const string GlobalAssemblyCacheDiagId = "SYSLIB0005";
+
+        internal const string ThreadAbortMessage = "Thread.Abort is not supported and throws PlatformNotSupportedException.";
+        internal const string ThreadAbortDiagId = "SYSLIB0006";
+
+        internal const string DefaultCryptoAlgorithmsMessage = "The default implementation of this cryptography algorithm is not supported.";
+        internal const string DefaultCryptoAlgorithmsDiagId = "SYSLIB0007";
+
+        internal const string CreatePdbGeneratorMessage = "The CreatePdbGenerator API is not supported and throws PlatformNotSupportedException.";
+        internal const string CreatePdbGeneratorDiagId = "SYSLIB0008";
+
+        internal const string AuthenticationManagerMessage = "The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.";
+        internal const string AuthenticationManagerDiagId = "SYSLIB0009";
+
+        internal const string RemotingApisMessage = "This Remoting API is not supported and throws PlatformNotSupportedException.";
+        internal const string RemotingApisDiagId = "SYSLIB0010";
+
+        internal const string BinaryFormatterMessage = "BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.";
+        internal const string BinaryFormatterDiagId = "SYSLIB0011";
+    }
+}
index 6b405a9..ba28f79 100644 (file)
@@ -305,7 +305,6 @@ namespace System.Buffers
 
             // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366892(v=vs.85).aspx
             [DllImport(KERNEL32_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
-            [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
             [return: MarshalAs(UnmanagedType.Bool)]
             public static extern bool VirtualFree(
                 [In] IntPtr lpAddress,
index c46cdcd..834d3a2 100644 (file)
@@ -63,7 +63,7 @@
   <!-- Warnings that should be disabled in our test projects. -->
   <PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true'">
     <!-- don't warn on usage of BinaryFormatter from test projects -->
-    <NoWarn>$(NoWarn);MSLIB0003</NoWarn>
+    <NoWarn>$(NoWarn);SYSLIB0011</NoWarn>
   </PropertyGroup>
 
   <!-- Common repo directories -->
index bf87a4e..15be91d 100644 (file)
@@ -8,6 +8,9 @@
   <PropertyGroup>
     <NoWarn Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFramework)' == 'netcoreapp2.1'">$(NoWarn);nullable</NoWarn>
     <NoWarn Condition="'$(GeneratePlatformNotSupportedAssembly)' == 'true' or '$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">$(NoWarn);nullable</NoWarn>
+    <!-- Ignore Obsolete errors within the generated shims that type-forward types.
+         SYSLIB0003 is for CAS. SYSLIB0004 is the obsoletion of CER. -->
+    <NoWarn Condition="'$(IsPartialFacadeAssembly)' == 'true'">$(NoWarn);SYSLIB0003;SYSLIB0004</NoWarn>
     <!-- Reset these properties back to blank, since they are defaulted by Microsoft.NET.Sdk -->
     <FileAlignment Condition="'$(FileAlignment)' == '512'" />
     <ErrorReport Condition="'$(ErrorReport)' == 'prompt'" />
index 0470f8b..ba2d1c6 100644 (file)
@@ -8,6 +8,8 @@
   </PropertyGroup>
   <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
   <PropertyGroup>
+    <!-- Constrained Execution Regions only apply to netstandard2.0 and net4* -->
+    <DefineConstants Condition="$(TargetFramework.StartsWith('netstandard2.0')) or $(TargetFramework.StartsWith('net4'))">$(DefineConstants);FEATURE_CER</DefineConstants>
     <IsPartialFacadeAssembly Condition="$(TargetFramework.StartsWith('net4'))">true</IsPartialFacadeAssembly>
     <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetFramework)' == 'netstandard2.0' and '$(TargetsAnyOS)' == 'true'">SR.PlatformNotSupported_SystemEvents</GeneratePlatformNotSupportedAssemblyMessage>
   </PropertyGroup>
index 4e1e0aa..ef40478 100644 (file)
@@ -1114,7 +1114,9 @@ namespace Microsoft.Win32
             }
         }
 
+#if FEATURE_CER
         [PrePrepareMethod]
+#endif
         private static void Shutdown(object? sender, EventArgs e)
         {
             Shutdown();
index 137e2d9..c4e7c24 100644 (file)
@@ -26,18 +26,18 @@ namespace System.ComponentModel.Design
         public static void Serialize(Stream o, string cryptoKey, DesigntimeLicenseContext context)
         {
             IFormatter formatter = new BinaryFormatter();
-#pragma warning disable MSLIB0003 // Issue https://github.com/dotnet/runtime/issues/39293 tracks finding an alternative to BinaryFormatter
+#pragma warning disable SYSLIB0011 // Issue https://github.com/dotnet/runtime/issues/39293 tracks finding an alternative to BinaryFormatter
             formatter.Serialize(o, new object[] { cryptoKey, context._savedLicenseKeys });
-#pragma warning restore MSLIB0003
+#pragma warning restore SYSLIB0011
         }
 
         internal static void Deserialize(Stream o, string cryptoKey, RuntimeLicenseContext context)
         {
-#pragma warning disable MSLIB0003 // Issue https://github.com/dotnet/runtime/issues/39293 tracks finding an alternative to BinaryFormatter
+#pragma warning disable SYSLIB0011 // Issue https://github.com/dotnet/runtime/issues/39293 tracks finding an alternative to BinaryFormatter
             IFormatter formatter = new BinaryFormatter();
 
             object obj = formatter.Deserialize(o);
-#pragma warning restore MSLIB0003
+#pragma warning restore SYSLIB0011
 
             if (obj is object[] value)
             {
index cc4817c..52da2e8 100644 (file)
@@ -317,10 +317,12 @@ namespace System.ConfigurationTests
                 throw new NotImplementedException();
             }
 
+#pragma warning disable SYSLIB0003 // Obsolete: CAS
             void IInternalConfigHost.GetRestrictedPermissions(IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady)
             {
                 throw new NotImplementedException();
             }
+#pragma warning restore SYSLIB0003 // Obsolete: CAS
         }
     }
 }
index 6ade9cb..10e27f3 100644 (file)
@@ -304,9 +304,9 @@ namespace System.Data
                     {
                         BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false));
                         MemoryStream memStream = new MemoryStream();
-#pragma warning disable MSLIB0003 // Issue https://github.com/dotnet/runtime/issues/39289 tracks finding an alternative to BinaryFormatter
+#pragma warning disable SYSLIB0011 // Issue https://github.com/dotnet/runtime/issues/39289 tracks finding an alternative to BinaryFormatter
                         bf.Serialize(memStream, Tables[i]);
-#pragma warning restore MSLIB0003
+#pragma warning restore SYSLIB0011
                         memStream.Position = 0;
                         info.AddValue(string.Format(CultureInfo.InvariantCulture, "DataSet.Tables_{0}", i), memStream.GetBuffer());
                     }
@@ -384,9 +384,9 @@ namespace System.Data
                         MemoryStream memStream = new MemoryStream(buffer);
                         memStream.Position = 0;
                         BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false));
-#pragma warning disable MSLIB0003 // Issue https://github.com/dotnet/runtime/issues/39289 tracks finding an alternative to BinaryFormatter
+#pragma warning disable SYSLIB0011 // Issue https://github.com/dotnet/runtime/issues/39289 tracks finding an alternative to BinaryFormatter
                         DataTable dt = (DataTable)bf.Deserialize(memStream);
-#pragma warning restore MSLIB0003
+#pragma warning restore SYSLIB0011
                         Tables.Add(dt);
                     }
 
index 8fe7210..de29572 100644 (file)
@@ -656,7 +656,6 @@ namespace System.Data.Common
             return ((null != inputString) ? inputString.Length : 0);
         }
 
-        [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         internal static IntPtr IntPtrOffset(IntPtr pbase, int offset)
         {
             if (4 == ADP.PtrSize)
index 6fa5604..61b550a 100644 (file)
@@ -19,7 +19,7 @@ namespace System.Data.ProviderBase
             if (0 < initialSize)
             {
                 _bufferLength = initialSize;
-                RuntimeHelpers.PrepareConstrainedRegions();
+
                 try { }
                 finally
                 {
@@ -62,7 +62,7 @@ namespace System.Data.ProviderBase
 
             string value = null;
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -90,7 +90,7 @@ namespace System.Data.ProviderBase
 
             string value = null;
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -116,7 +116,7 @@ namespace System.Data.ProviderBase
 
             byte value;
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -149,7 +149,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(startIndex + length <= destination.Length, "destination too small");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -182,7 +182,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(startIndex + length <= destination.Length, "destination too small");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -214,7 +214,7 @@ namespace System.Data.ProviderBase
 
             short value;
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -241,7 +241,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(startIndex + length <= destination.Length, "destination too small");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -266,7 +266,7 @@ namespace System.Data.ProviderBase
 
             int value;
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -293,7 +293,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(startIndex + length <= destination.Length, "destination too small");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -318,7 +318,7 @@ namespace System.Data.ProviderBase
 
             long value;
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -344,7 +344,7 @@ namespace System.Data.ProviderBase
 
             IntPtr value;
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -388,7 +388,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -412,7 +412,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(0 == offset % 4, "invalid alignment");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -438,7 +438,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(startIndex + length <= source.Length, "source too small");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -464,7 +464,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(startIndex + length <= source.Length, "source too small");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -493,7 +493,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(0 == offset % 2, "invalid alignment");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -519,7 +519,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(startIndex + length <= source.Length, "source too small");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -543,7 +543,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(0 == offset % 4, "invalid alignment");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -569,7 +569,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(startIndex + length <= source.Length, "source too small");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -593,7 +593,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -617,7 +617,7 @@ namespace System.Data.ProviderBase
             Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
 
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -642,7 +642,7 @@ namespace System.Data.ProviderBase
         internal void ZeroMemory()
         {
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
index f12187e..be558f4 100644 (file)
@@ -675,7 +675,6 @@ namespace System.Data.Odbc
                 bool mustRelease = false;
                 CNativeBuffer parameterBuffer = _cmdWrapper._nativeParameterBuffer;
 
-                RuntimeHelpers.PrepareConstrainedRegions();
                 try
                 {
                     //Handle Parameters
index 1f5b81c..6cd776f 100644 (file)
@@ -57,9 +57,7 @@ namespace System.Data.Odbc
 
             Debug.Assert(HandleState.Connected <= _handleState, "AutoCommitOff while in wrong state?");
 
-            // Avoid runtime injected errors in the following block.
             // must call SQLSetConnectAttrW and set _handleState
-            RuntimeHelpers.PrepareConstrainedRegions();
             try { }
             finally
             {
@@ -141,7 +139,7 @@ namespace System.Data.Odbc
         internal ODBC32.RetCode CompleteTransaction(short transactionOperation)
         {
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 DangerousAddRef(ref mustRelease);
@@ -157,15 +155,12 @@ namespace System.Data.Odbc
             }
         }
 
-        [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         private ODBC32.RetCode CompleteTransaction(short transactionOperation, IntPtr handle)
         {
             // must only call this code from ReleaseHandle or DangerousAddRef region
 
             ODBC32.RetCode retcode = ODBC32.RetCode.SUCCESS;
 
-            // using ConstrainedRegions to make the native ODBC call and change the _handleState
-            RuntimeHelpers.PrepareConstrainedRegions();
             try { }
             finally
             {
@@ -195,8 +190,6 @@ namespace System.Data.Odbc
 
             ODBC32.RetCode retcode;
 
-            // Avoid runtime injected errors in the following block.
-            RuntimeHelpers.PrepareConstrainedRegions();
             try { }
             finally
             {
index a8924b3..d66f5f2 100644 (file)
@@ -2344,7 +2344,6 @@ namespace System.Data.Odbc
             bool mustRelease = false;
             Debug.Assert(buffer.Length >= 264, "Native buffer to small (_buffer.Length < 264)");
 
-            RuntimeHelpers.PrepareConstrainedRegions();
             try
             {
                 buffer.DangerousAddRef(ref mustRelease);
@@ -2530,7 +2529,6 @@ namespace System.Data.Odbc
             bool mustRelease = false;
             Debug.Assert(buffer.Length >= 544, "Native buffer to small (_buffer.Length < 544)");
 
-            RuntimeHelpers.PrepareConstrainedRegions();
             try
             {
                 buffer.DangerousAddRef(ref mustRelease);
index 8c4f340..4936464 100644 (file)
@@ -21,8 +21,6 @@ namespace System.Data.Odbc
             bool mustRelease = false;
             ODBC32.RetCode retcode = ODBC32.RetCode.SUCCESS;
 
-            // using ConstrainedRegions to make the native ODBC call and AddRef the parent
-            RuntimeHelpers.PrepareConstrainedRegions();
             try
             {
                 // validate handleType
@@ -85,7 +83,7 @@ namespace System.Data.Odbc
             int cbActual;
             ODBC32.RetCode retcode;
             bool mustRelease = false;
-            RuntimeHelpers.PrepareConstrainedRegions();
+
             try
             {
                 // must addref before calling native so it won't be released just after
index 70f4833..192047a 100644 (file)
@@ -265,7 +265,6 @@ namespace System.Diagnostics
                 throw new ArgumentException(SR.Format(SR.ParameterTooLong, nameof(source), 254 - EventLogKey.Length));
 
             Mutex mutex = null;
-            RuntimeHelpers.PrepareConstrainedRegions();
             try
             {
                 NetFrameworkUtils.EnterMutex(eventLogMutexName, ref mutex);
@@ -371,7 +370,6 @@ namespace System.Diagnostics
             RegistryKey eventlogkey = null;
 
             Mutex mutex = null;
-            RuntimeHelpers.PrepareConstrainedRegions();
             try
             {
                 NetFrameworkUtils.EnterMutex(eventLogMutexName, ref mutex);
@@ -442,7 +440,6 @@ namespace System.Diagnostics
             }
 
             Mutex mutex = null;
-            RuntimeHelpers.PrepareConstrainedRegions();
             try
             {
                 NetFrameworkUtils.EnterMutex(eventLogMutexName, ref mutex);
index 38ef9a5..17686e5 100644 (file)
@@ -1250,7 +1250,7 @@ namespace System.Diagnostics
             if (!EventLog.SourceExists(sourceName, currentMachineName, true))
             {
                 Mutex mutex = null;
-                RuntimeHelpers.PrepareConstrainedRegions();
+
                 try
                 {
                     NetFrameworkUtils.EnterMutex(eventLogMutexName, ref mutex);
index 82ca07b..f1a5ef3 100644 (file)
@@ -459,7 +459,6 @@ namespace Microsoft.Win32
         internal static extern bool EvtCancel(EventLogHandle handle);
 
         [DllImport(WEVTAPI)]
-        [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
         internal static extern bool EvtClose(IntPtr handle);
 
         /*
index fe9d7bd..39d78ed 100644 (file)
@@ -1093,7 +1093,6 @@ namespace System.DirectoryServices.Protocols
             bool success = false;
             if (ldapConnection != null && ldapConnection._ldapHandle != null && !ldapConnection._ldapHandle.IsInvalid)
             {
-                RuntimeHelpers.PrepareConstrainedRegions();
                 try { }
                 finally
                 {
@@ -1108,7 +1107,6 @@ namespace System.DirectoryServices.Protocols
         {
             if (ldapConnection != null && ldapConnection._ldapHandle != null && !ldapConnection._ldapHandle.IsInvalid)
             {
-                RuntimeHelpers.PrepareConstrainedRegions();
                 try { }
                 finally
                 {
index b4b7d85..7b1ebc0 100644 (file)
@@ -5,6 +5,9 @@ using System.Security.Permissions;
 
 namespace System.DirectoryServices
 {
+#pragma warning disable SYSLIB0003
+    // Conditionally marking this type as obsolete in .NET 5+ will require diverging its net5.0 build from netstandard2.0
+    // https://github.com/dotnet/runtime/issues/39413
     public sealed class DirectoryServicesPermission : ResourcePermissionBase
     {
         public DirectoryServicesPermission() { }
@@ -13,4 +16,5 @@ namespace System.DirectoryServices
         public DirectoryServicesPermission(DirectoryServicesPermissionAccess permissionAccess, string path) { }
         public DirectoryServicesPermissionEntryCollection PermissionEntries { get; }
     }
+#pragma warning restore SYSLIB0003
 }
index 4c728ac..b4d0941 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.DirectoryServices
 {
+#pragma warning disable SYSLIB0003
+    // Conditionally marking this type as obsolete in .NET 5+ will require diverging its net5.0 build from netstandard2.0
+    // https://github.com/dotnet/runtime/issues/39413
     [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct |
         AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Event,
         AllowMultiple = true, Inherited = false)]
@@ -16,4 +19,5 @@ namespace System.DirectoryServices
         public string Path { get; set; }
         public override IPermission CreatePermission() { return default(IPermission); }
     }
+#pragma warning restore SYSLIB0003
 }
index 8cf66c6..53be1a5 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <NoWarn>$(NoWarn);CS0618</NoWarn>
+    <!-- SYSLIB0003: CAS is obsolete, but we still have tests referencing it -->
+    <NoWarn>$(NoWarn);SYSLIB0003</NoWarn>
     <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetFrameworkCurrent)</TargetFrameworks>
   </PropertyGroup>
   <ItemGroup>
index ed5e7df..5612b92 100644 (file)
@@ -28,7 +28,6 @@ namespace System.Drawing
         /// <summary>
         /// Called on process exit
         /// </summary>
-        [PrePrepareMethod]
         private static void OnShutdown(object? sender, EventArgs e) => Current.Invalidate();
     }
 }
index cca9e01..9428feb 100644 (file)
@@ -918,7 +918,6 @@ namespace System.Drawing
         }
 
         // This is called from AppDomain.ProcessExit and AppDomain.DomainUnload.
-        [PrePrepareMethod]
         private static void OnDomainUnload(object? sender, EventArgs e)
         {
             if (s_halftonePalette != IntPtr.Zero)
index b9b6e77..0bafe3e 100644 (file)
@@ -132,7 +132,9 @@ namespace System.Drawing
             if (ht.ContainsKey(image))
             {
                 AnimateEventArgs evtArgs = (AnimateEventArgs)ht[image]!;
+#pragma warning disable SYSLIB0006 // https://github.com/dotnet/runtime/issues/39405
                 evtArgs.RunThread!.Abort();
+#pragma warning restore SYSLIB0006
                 ht.Remove(image);
             }
         }
index 50aa16a..8168691 100644 (file)
@@ -221,7 +221,17 @@ namespace System.IO.Pipes
         {
             CheckWriteOperations();
             ExecuteHelper execHelper = new ExecuteHelper(impersonationWorker, InternalHandle);
-            RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(tryCode, cleanupCode, execHelper);
+            bool exceptionThrown = true;
+
+            try
+            {
+                ImpersonateAndTryCode(execHelper);
+                exceptionThrown = false;
+            }
+            finally
+            {
+                RevertImpersonationOnBackout(execHelper, exceptionThrown);
+            }
 
             // now handle win32 impersonate/revert specific errors by throwing corresponding exceptions
             if (execHelper._impersonateErrorCode != 0)
@@ -234,11 +244,6 @@ namespace System.IO.Pipes
             }
         }
 
-        // the following are needed for CER
-
-        private static readonly RuntimeHelpers.TryCode tryCode = new RuntimeHelpers.TryCode(ImpersonateAndTryCode);
-        private static readonly RuntimeHelpers.CleanupCode cleanupCode = new RuntimeHelpers.CleanupCode(RevertImpersonationOnBackout);
-
         private static void ImpersonateAndTryCode(object? helper)
         {
             ExecuteHelper execHelper = (ExecuteHelper)helper!;
index 56502d0..a1b45cc 100644 (file)
@@ -37,9 +37,9 @@ namespace System.IO.PortsTests
             Assert.True(false, string.Format(format, args));
         }
 
-#pragma warning disable MSLIB0001 // Encoding.UTF7 property is obsolete
+#pragma warning disable SYSLIB0001 // Encoding.UTF7 property is obsolete
         protected static Encoding LegacyUTF7Encoding => Encoding.UTF7;
-#pragma warning restore MSLIB0001
+#pragma warning restore SYSLIB0001
 
         /// <summary>
         /// Returns a value stating whether <paramref name="encoding"/> is UTF-7.
index d26f21a..09923d4 100644 (file)
@@ -1144,6 +1144,7 @@ namespace System.Runtime.CompilerServices
     public abstract partial class DebugInfoGenerator
     {
         protected DebugInfoGenerator() { }
+        [System.ObsoleteAttribute("The CreatePdbGenerator API is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0008", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static System.Runtime.CompilerServices.DebugInfoGenerator CreatePdbGenerator() { throw null; }
         public abstract void MarkSequencePoint(System.Linq.Expressions.LambdaExpression method, int ilOffset, System.Linq.Expressions.DebugInfoExpression sequencePoint);
     }
index c6555f3..07d0ceb 100644 (file)
@@ -11,6 +11,8 @@
     <DefineConstants Condition=" '$(FeatureInterpret)' == 'true' ">$(DefineConstants);FEATURE_INTERPRET</DefineConstants>
   </PropertyGroup>
   <ItemGroup>
+    <Compile Include="$(CommonPath)System\Obsoletions.cs"
+             Link="Common\System\Obsoletions.cs" />
     <Compile Include="$(CommonPath)System\Collections\Generic\ArrayBuilder.cs"
              Link="Common\System\Collections\Generic\ArrayBuilder.cs" />
     <Compile Include="System\Dynamic\Utils\CacheDict.cs" />
index 5994252..a1bd0c8 100644 (file)
@@ -17,6 +17,7 @@ namespace System.Runtime.CompilerServices
         /// Creates PDB symbol generator.
         /// </summary>
         /// <returns>PDB symbol generator.</returns>
+        [Obsolete(Obsoletions.CreatePdbGeneratorMessage, DiagnosticId = Obsoletions.CreatePdbGeneratorDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static DebugInfoGenerator CreatePdbGenerator()
         {
             // Creating PDBs is not supported in .NET Core
index fcd291d..1fc5c6d 100644 (file)
@@ -12,7 +12,9 @@ namespace System.Net
         public static System.Net.ICredentialPolicy? CredentialPolicy { get { throw null; } set { } }
         public static System.Collections.Specialized.StringDictionary CustomTargetNameDictionary { get { throw null; } }
         public static System.Collections.IEnumerator RegisteredModules { get { throw null; } }
+        [System.ObsoleteAttribute("The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0009", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static System.Net.Authorization? Authenticate(string challenge, System.Net.WebRequest request, System.Net.ICredentials credentials) { throw null; }
+        [System.ObsoleteAttribute("The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0009", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static System.Net.Authorization? PreAuthenticate(System.Net.WebRequest request, System.Net.ICredentials credentials) { throw null; }
         public static void Register(System.Net.IAuthenticationModule authenticationModule) { }
         public static void Unregister(System.Net.IAuthenticationModule authenticationModule) { }
index bfe01ea..9db0985 100644 (file)
@@ -43,6 +43,8 @@
     <Compile Include="System\Net\Cache\HttpRequestCacheLevel.cs" />
     <Compile Include="System\Net\Cache\HttpRequestCachePolicy.cs" />
     <Compile Include="System\Net\NetEventSource.Requests.cs" />
+    <Compile Include="$(CommonPath)System\Obsoletions.cs"
+             Link="Common\System\Obsoletions.cs" />
     <Compile Include="$(CommonPath)System\Net\Http\HttpHandlerDefaults.cs"
              Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
     <Compile Include="$(CommonPath)System\Net\InternalException.cs"
index a0737c2..5c01404 100644 (file)
@@ -14,9 +14,11 @@ namespace System.Net
 
         public static StringDictionary CustomTargetNameDictionary { get; } = new StringDictionary();
 
+        [Obsolete(Obsoletions.AuthenticationManagerMessage, DiagnosticId = Obsoletions.AuthenticationManagerDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static Authorization? Authenticate(string challenge, WebRequest request, ICredentials credentials) =>
             throw new PlatformNotSupportedException();
 
+        [Obsolete(Obsoletions.AuthenticationManagerMessage, DiagnosticId = Obsoletions.AuthenticationManagerDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static Authorization? PreAuthenticate(WebRequest request, ICredentials credentials) =>
             throw new PlatformNotSupportedException();
 
index fab7e11..0d08bbe 100644 (file)
@@ -14,8 +14,10 @@ namespace System.Net.Tests
         [Fact]
         public void Authenticate_NotSupported()
         {
+#pragma warning disable SYSLIB0009 // The methods are obsolete
             Assert.Throws<PlatformNotSupportedException>(() => AuthenticationManager.Authenticate(null, null, null));
             Assert.Throws<PlatformNotSupportedException>(() => AuthenticationManager.PreAuthenticate(null, null));
+#pragma warning restore SYSLIB0009
         }
 
         [Fact]
index 63314c0..b217b42 100644 (file)
     <Compile Include="$(MSBuildThisFileDirectory)System\Object.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\ObjectDisposedException.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\ObsoleteAttribute.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)System\Obsoletions.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\OperatingSystem.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\OperationCanceledException.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\OutOfMemoryException.cs" />
     <Compile Include="$(CommonPath)System\HResults.cs">
       <Link>Common\System\HResults.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)System\Obsoletions.cs">
+      <Link>Common\System\Obsoletions.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)System\SR.cs">
       <Link>Common\System\SR.cs</Link>
     </Compile>
index 696e1f4..06c6410 100644 (file)
@@ -36,6 +36,7 @@ namespace System
 
         public AppDomainSetup SetupInformation => new AppDomainSetup();
 
+        [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public PermissionSet PermissionSet => new PermissionSet(PermissionState.Unrestricted);
 
         public event UnhandledExceptionEventHandler? UnhandledException
index 88a677b..cabafa7 100644 (file)
@@ -440,7 +440,7 @@ namespace System.Diagnostics.Tracing
                 descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1);
                 descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1);
 
-#if (!ES_BUILD_PCL)
+#if (!ES_BUILD_PCL && !NETCOREAPP)
                 System.Runtime.CompilerServices.RuntimeHelpers.PrepareConstrainedRegions();
 #endif
                 try
@@ -624,7 +624,7 @@ namespace System.Diagnostics.Tracing
                         descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1);
 #endif // FEATURE_MANAGED_ETW
 
-#if (!ES_BUILD_PCL)
+#if (!ES_BUILD_PCL && !NETCOREAPP)
                         System.Runtime.CompilerServices.RuntimeHelpers.PrepareConstrainedRegions();
 #endif
                         EventOpcode opcode = (EventOpcode)descriptor.Opcode;
@@ -731,7 +731,7 @@ namespace System.Diagnostics.Tracing
             DispatchToAllListeners(-1, eventCallbackArgs);
         }
 
-#if (!ES_BUILD_PCL)
+#if (!ES_BUILD_PCL && !NETCOREAPP)
         [System.Runtime.ConstrainedExecution.ReliabilityContract(
             System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState,
             System.Runtime.ConstrainedExecution.Cer.Success)]
index 25da5a6..042617e 100644 (file)
@@ -13,11 +13,13 @@ namespace System
         {
         }
 
+        [Obsolete(Obsoletions.RemotingApisMessage, DiagnosticId = Obsoletions.RemotingApisDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public object GetLifetimeService()
         {
             throw new PlatformNotSupportedException(SR.PlatformNotSupported_Remoting);
         }
 
+        [Obsolete(Obsoletions.RemotingApisMessage, DiagnosticId = Obsoletions.RemotingApisDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public virtual object InitializeLifetimeService()
         {
             throw new PlatformNotSupportedException(SR.PlatformNotSupported_Remoting);
diff --git a/src/libraries/System.Private.CoreLib/src/System/Obsoletions.cs b/src/libraries/System.Private.CoreLib/src/System/Obsoletions.cs
deleted file mode 100644 (file)
index ce8f374..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System
-{
-    internal static class Obsoletions
-    {
-        internal const string SharedUrlFormat = "https://aka.ms/dotnet-warnings/{0}";
-
-        internal const string SystemTextEncodingUTF7Message = "The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.";
-        internal const string SystemTextEncodingUTF7DiagId = "MSLIB0001";
-    }
-}
index e0b1cab..bd6dd45 100644 (file)
@@ -165,6 +165,7 @@ namespace System.Reflection
         /*
           Returns true if the assembly was loaded from the global assembly cache.
         */
+        [Obsolete(Obsoletions.GlobalAssemblyCacheMessage, DiagnosticId = Obsoletions.GlobalAssemblyCacheDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public virtual bool GlobalAssemblyCache => throw NotImplemented.ByDesign;
         public virtual long HostContext => throw NotImplemented.ByDesign;
 
index 083b6a1..727a1be 100644 (file)
@@ -88,6 +88,7 @@ namespace System.Runtime.CompilerServices
             return GetUninitializedObjectInternal(type);
         }
 
+        [Obsolete(Obsoletions.ConstrainedExecutionRegionMessage, DiagnosticId = Obsoletions.ConstrainedExecutionRegionDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, object? userData)
         {
             if (code == null)
@@ -108,18 +109,22 @@ namespace System.Runtime.CompilerServices
             }
         }
 
+        [Obsolete(Obsoletions.ConstrainedExecutionRegionMessage, DiagnosticId = Obsoletions.ConstrainedExecutionRegionDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static void PrepareContractedDelegate(Delegate d)
         {
         }
 
+        [Obsolete(Obsoletions.ConstrainedExecutionRegionMessage, DiagnosticId = Obsoletions.ConstrainedExecutionRegionDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static void ProbeForSufficientStack()
         {
         }
 
+        [Obsolete(Obsoletions.ConstrainedExecutionRegionMessage, DiagnosticId = Obsoletions.ConstrainedExecutionRegionDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static void PrepareConstrainedRegions()
         {
         }
 
+        [Obsolete(Obsoletions.ConstrainedExecutionRegionMessage, DiagnosticId = Obsoletions.ConstrainedExecutionRegionDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static void PrepareConstrainedRegionsNoOP()
         {
         }
index e15003a..40dbd4f 100644 (file)
@@ -3,6 +3,7 @@
 
 namespace System.Runtime.ConstrainedExecution
 {
+    [Obsolete(Obsoletions.ConstrainedExecutionRegionMessage, DiagnosticId = Obsoletions.ConstrainedExecutionRegionDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     public enum Cer : int
     {
         None = 0,
index a22f4b2..12f3e8a 100644 (file)
@@ -3,6 +3,7 @@
 
 namespace System.Runtime.ConstrainedExecution
 {
+    [Obsolete(Obsoletions.ConstrainedExecutionRegionMessage, DiagnosticId = Obsoletions.ConstrainedExecutionRegionDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     public enum Consistency : int
     {
         MayCorruptProcess = 0,
index c8c3ecf..e0eb0c7 100644 (file)
@@ -3,6 +3,7 @@
 
 namespace System.Runtime.ConstrainedExecution
 {
+    [Obsolete(Obsoletions.ConstrainedExecutionRegionMessage, DiagnosticId = Obsoletions.ConstrainedExecutionRegionDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     [AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
     public sealed class PrePrepareMethodAttribute : Attribute
     {
index 261b3de..d9a8272 100644 (file)
@@ -17,6 +17,7 @@
 
 namespace System.Runtime.ConstrainedExecution
 {
+    [Obsolete(Obsoletions.ConstrainedExecutionRegionMessage, DiagnosticId = Obsoletions.ConstrainedExecutionRegionDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Interface /* | AttributeTargets.Delegate*/, Inherited = false)]
     public sealed class ReliabilityContractAttribute : Attribute
     {
index 500b037..6ed3a92 100644 (file)
@@ -3,6 +3,7 @@
 
 namespace System.Security
 {
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     public partial interface IPermission : ISecurityEncodable
     {
         IPermission Copy();
index 3f2e814..cd0a5ac 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security
 {
+#if SYSTEM_PRIVATE_CORELIB
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public partial interface IStackWalk
     {
         void Assert();
index a3d4a8b..b64def0 100644 (file)
@@ -8,6 +8,9 @@ using System.Runtime.Serialization;
 
 namespace System.Security
 {
+#if SYSTEM_PRIVATE_CORELIB
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public partial class PermissionSet : ICollection, IEnumerable, IDeserializationCallback, ISecurityEncodable, IStackWalk
     {
         public PermissionSet(PermissionState state) { }
index 6504fc5..742b076 100644 (file)
@@ -3,6 +3,7 @@
 
 namespace System.Security.Permissions
 {
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public abstract partial class CodeAccessSecurityAttribute : SecurityAttribute
     {
index abcc0a9..87c4bb4 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if SYSTEM_PRIVATE_CORELIB
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public enum PermissionState
     {
         None = 0,
index 17242e2..6bbaa15 100644 (file)
@@ -3,20 +3,17 @@
 
 namespace System.Security.Permissions
 {
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     public enum SecurityAction
     {
         Assert = 3,
         Demand = 2,
-        [Obsolete("Deny is obsolete and will be removed in a future release of the .NET Framework. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
         Deny = 4,
         InheritanceDemand = 7,
         LinkDemand = 6,
         PermitOnly = 5,
-        [Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
         RequestMinimum = 8,
-        [Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
         RequestOptional = 9,
-        [Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
         RequestRefuse = 10,
     }
 }
index 0607153..7bd4705 100644 (file)
@@ -3,6 +3,7 @@
 
 namespace System.Security.Permissions
 {
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public abstract partial class SecurityAttribute : Attribute
     {
index 4d2b672..1c038c0 100644 (file)
@@ -3,6 +3,7 @@
 
 namespace System.Security.Permissions
 {
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class SecurityPermissionAttribute : CodeAccessSecurityAttribute
     {
index 07700b2..5202a9d 100644 (file)
@@ -3,6 +3,7 @@
 
 namespace System.Security.Permissions
 {
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
     [Flags]
     public enum SecurityPermissionFlag
     {
index c145220..6bedf38 100644 (file)
@@ -245,9 +245,9 @@ namespace System.Text
 
                         if (LocalAppContextSwitches.EnableUnsafeUTF7Encoding)
                         {
-#pragma warning disable MSLIB0001 // Encoding.UTF7 property getter is obsolete
+#pragma warning disable SYSLIB0001 // Encoding.UTF7 property getter is obsolete
                             return UTF7;
-#pragma warning restore MSLIB0001
+#pragma warning restore SYSLIB0001
                         }
                         else
                         {
index fb6cbbb..7b416f1 100644 (file)
@@ -26,11 +26,11 @@ namespace System.Text
         private const string optionalChars =
             "!\"#$%&*;<=>@[]^_`{|}";
 
-#pragma warning disable MSLIB0001
+#pragma warning disable SYSLIB0001
         // Used by Encoding.UTF7 for lazy initialization
         // The initialization code will not be run until a static member of the class is referenced
         internal static readonly UTF7Encoding s_default = new UTF7Encoding();
-#pragma warning restore MSLIB0001
+#pragma warning restore SYSLIB0001
 
         // The set of base 64 characters.
         private byte[] _base64Bytes;
index edc0566..f468e6c 100644 (file)
@@ -177,11 +177,13 @@ namespace System.Threading
             }
         }
 
+        [Obsolete(Obsoletions.ThreadAbortMessage, DiagnosticId = Obsoletions.ThreadAbortDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public void Abort()
         {
             throw new PlatformNotSupportedException(SR.PlatformNotSupported_ThreadAbort);
         }
 
+        [Obsolete(Obsoletions.ThreadAbortMessage, DiagnosticId = Obsoletions.ThreadAbortDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public void Abort(object? stateInfo)
         {
             throw new PlatformNotSupportedException(SR.PlatformNotSupported_ThreadAbort);
index 3ebebfb..fe7d84f 100644 (file)
@@ -301,10 +301,7 @@ namespace System.Xml.Serialization
                             continue;
                         }
 
-                        if (!a.GlobalAssemblyCache)
-                        {
-                            assemblies[name] = a;
-                        }
+                        assemblies[name] = a;
                     }
                 }
 
index 47190ab..bd34fa0 100644 (file)
@@ -12,6 +12,7 @@ namespace System.Reflection.Emit
         public override string? CodeBase { get { throw null; } }
         public override System.Reflection.MethodInfo? EntryPoint { get { throw null; } }
         public override string? FullName { get { throw null; } }
+        [Obsolete("The Global Assembly Cache is not supported.", DiagnosticId = "SYSLIB0005", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public override bool GlobalAssemblyCache { get { throw null; } }
         public override long HostContext { get { throw null; } }
         public override string ImageRuntimeVersion { get { throw null; } }
index bb96d4b..80692bd 100644 (file)
@@ -8,8 +8,10 @@
     <ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
     <Nullable>enable</Nullable>
   </PropertyGroup>
-    <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
+  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
   <PropertyGroup>
+    <!-- Constrained Execution Regions only apply to netstandard2.0 and net4* -->
+    <DefineConstants Condition="$(TargetFramework.StartsWith('netstandard2.0')) or $(TargetFramework.StartsWith('net4'))">$(DefineConstants);FEATURE_CER</DefineConstants>
     <PackageTargetFramework Condition="'$(TargetFramework)' == 'netstandard1.1'">netstandard1.1;portable-net45+win8</PackageTargetFramework>
   </PropertyGroup>
   <ItemGroup>
index 899fdee..37b3dc6 100644 (file)
@@ -17,14 +17,13 @@ namespace System.Reflection.Internal
 
             public DisposableData(IDisposable accessor, SafeBuffer safeBuffer, long offset)
             {
+#if FEATURE_CER
                 // Make sure the current thread isn't aborted in between acquiring the pointer and assigning the fields.
-#if !NETSTANDARD1_1
                 RuntimeHelpers.PrepareConstrainedRegions();
-#endif
                 try
-                {
-                }
+                { /* intentionally left blank */ }
                 finally
+#endif
                 {
                     byte* basePointer = null;
                     safeBuffer.AcquirePointer(ref basePointer);
@@ -37,15 +36,14 @@ namespace System.Reflection.Internal
 
             protected override void Release()
             {
+#if FEATURE_CER
                 // Make sure the current thread isn't aborted in between zeroing the references and releasing/disposing.
                 // Safe buffer only frees the underlying resource if its ref count drops to zero, so we have to make sure it does.
-#if !NETSTANDARD1_1
                 RuntimeHelpers.PrepareConstrainedRegions();
-#endif
                 try
-                {
-                }
+                { /* intentionally left blank */ }
                 finally
+#endif
                 {
                     Interlocked.Exchange(ref _safeBuffer, null)?.ReleasePointer();
                     Interlocked.Exchange(ref _accessor, null)?.Dispose();
index ec1c457..552a854 100644 (file)
@@ -21,14 +21,13 @@ namespace System.Reflection.Internal
 
             public DisposableData(int size)
             {
+#if FEATURE_CER
                 // make sure the current thread isn't aborted in between allocating and storing the pointer
-#if !NETSTANDARD1_1
                 RuntimeHelpers.PrepareConstrainedRegions();
-#endif
                 try
-                {
-                }
+                { /* intentionally left blank */ }
                 finally
+#endif
                 {
                     _pointer = Marshal.AllocHGlobal(size);
                 }
@@ -36,14 +35,13 @@ namespace System.Reflection.Internal
 
             protected override void Release()
             {
+#if FEATURE_CER
                 // make sure the current thread isn't aborted in between zeroing the pointer and freeing the memory
-#if !NETSTANDARD1_1
                 RuntimeHelpers.PrepareConstrainedRegions();
-#endif
                 try
-                {
-                }
+                { /* intentionally left blank */ }
                 finally
+#endif
                 {
                     IntPtr ptr = Interlocked.Exchange(ref _pointer, IntPtr.Zero);
                     if (ptr != IntPtr.Zero)
index 8ee38c0..a2dfc0f 100644 (file)
@@ -17,14 +17,13 @@ namespace System.Reflection.Internal
 
         public PinnedObject(object obj)
         {
+#if FEATURE_CER
             // Make sure the current thread isn't aborted in between allocating the handle and storing it.
-#if !NETSTANDARD1_1
             RuntimeHelpers.PrepareConstrainedRegions();
-#endif
             try
-            {
-            }
+            { /* intentionally left blank */ }
             finally
+#endif
             {
                 _handle = GCHandle.Alloc(obj, GCHandleType.Pinned);
                 _isValid = 1;
@@ -33,8 +32,8 @@ namespace System.Reflection.Internal
 
         protected override void Release()
         {
+#if FEATURE_CER
             // Make sure the current thread isn't aborted in between zeroing the handle and freeing it.
-#if !NETSTANDARD1_1
             RuntimeHelpers.PrepareConstrainedRegions();
 #endif
             try
index 3de6b68..551ee91 100644 (file)
@@ -45,14 +45,13 @@ namespace System.Reflection.Metadata.Ecma335
 
         protected override void Release()
         {
+#if FEATURE_CER
             // Make sure the current thread isn't aborted in the middle of the operation.
-#if !NETSTANDARD1_1
             RuntimeHelpers.PrepareConstrainedRegions();
-#endif
             try
-            {
-            }
+            { /* intentionally left blank */ }
             finally
+#endif
             {
                 var blobs = Interlocked.Exchange(ref _blobs, null);
 
@@ -94,13 +93,12 @@ namespace System.Reflection.Metadata.Ecma335
             var blobs = GetBlobs();
 
             MemoryBlock result;
-#if !NETSTANDARD1_1
+#if FEATURE_CER
             RuntimeHelpers.PrepareConstrainedRegions();
-#endif
             try
-            {
-            }
+            { /* intentionally left blank */ }
             finally
+#endif
             {
                 var blob = new PinnedBlob(GCHandle.Alloc(value, GCHandleType.Pinned), value.Length);
                 blobs.Add(rawHandle, blob);
index b1f6f31..006e205 100644 (file)
@@ -8,6 +8,10 @@
     <ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
     <Nullable>enable</Nullable>
   </PropertyGroup>
+  <!-- We conditionally apply net5.0+ obsoletions -->
+  <PropertyGroup Condition="!($(TargetFramework.StartsWith('netcoreapp')) or $(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('net4')))">
+    <DefineConstants>$(DefineConstants);NET50_OBSOLETIONS</DefineConstants>
+  </PropertyGroup>
   <ItemGroup>
     <Compile Include="System\CoreRtBridge.cs" />
     <Compile Include="System\Reflection\DefaultBinder.cs" />
index 8a539e8..b15e446 100644 (file)
@@ -145,6 +145,9 @@ namespace System.Reflection.TypeLoading
 
         // Miscellaneous properties
         public sealed override bool ReflectionOnly => true;
+#if NET50_OBSOLETIONS
+        [Obsolete("The Global Assembly Cache is not supported.", DiagnosticId = "SYSLIB0005", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+#endif
         public sealed override bool GlobalAssemblyCache => false;
         public sealed override long HostContext => 0;
         public abstract override string ImageRuntimeVersion { get; }
index 2c3eb70..be8b471 100644 (file)
@@ -2,6 +2,8 @@
   <PropertyGroup>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkCurrent)</TargetFrameworks>
+    <!-- The GAC is obsolete, but there are unit tests still referencing it -->
+    <NoWarn>$(NoWarn);SYSLIB0005</NoWarn>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="$(CommonTestPath)System\IO\TempDirectory.cs"
index 2d39889..a244bbb 100644 (file)
@@ -229,11 +229,13 @@ namespace System.Reflection.Tests
             Assert.Equal(typeof(G<G<int>>), t);
         }
 
+#pragma warning disable SYSLIB0005 // Obsolete: GAC
         [Fact]
         public void GlobalAssemblyCache()
         {
             Assert.False(typeof(AssemblyTests).Assembly.GlobalAssemblyCache);
         }
+#pragma warning restore SYSLIB0005 // Obsolete: GAC
 
         [Fact]
         public void HostContext()
index 62e356f..c6e0bfc 100644 (file)
@@ -4,6 +4,8 @@
 // Changes to this file must follow the https://aka.ms/api-review process.
 // ------------------------------------------------------------------------------
 
+#pragma warning disable SYSLIB0003 // CAS Obsoletions
+
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.AppDomain))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.AppDomainSetup))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.AppDomainUnloadedException))]
index 89ec53e..4388168 100644 (file)
@@ -740,9 +740,11 @@ namespace System.Tests
         [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
         public static void GetPermissionSet()
         {
+#pragma warning disable SYSLIB0003 // Obsolete: CAS
             RemoteExecutor.Invoke(() => {
                 Assert.Equal(new PermissionSet(PermissionState.Unrestricted), AppDomain.CurrentDomain.PermissionSet);
             }).Dispose();
+#pragma warning restore SYSLIB0003 // Obsolete: CAS
         }
 
         [Theory]
index 97c7539..37f4fd1 100644 (file)
@@ -14,8 +14,10 @@ namespace System.Tests
         public static void MarshalByRefObjectTests()
         {
             var obj = new MarshalByRefObjectTest();
+#pragma warning disable SYSLIB0010 // Obsolete: Remoting APIs
             Assert.Throws<PlatformNotSupportedException>(() => obj.GetLifetimeService());
             Assert.Throws<PlatformNotSupportedException>(() => obj.InitializeLifetimeService());
+#pragma warning restore SYSLIB0010 // Obsolete: Remoting APIs
 
             var clone = obj.MemberwiseClone(false);
             Assert.NotNull(clone);
index 4681ba9..dc9d5f7 100644 (file)
@@ -15,11 +15,11 @@ namespace System.Runtime.Serialization
         public abstract System.Runtime.Serialization.SerializationBinder? Binder { get; set; }
         public abstract System.Runtime.Serialization.StreamingContext Context { get; set; }
         public abstract System.Runtime.Serialization.ISurrogateSelector? SurrogateSelector { get; set; }
-        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public abstract object Deserialize(System.IO.Stream serializationStream);
         protected virtual object? GetNext(out long objID) { throw null; }
         protected virtual long Schedule(object? obj) { throw null; }
-        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public abstract void Serialize(System.IO.Stream serializationStream, object graph);
         protected abstract void WriteArray(object obj, string name, System.Type memberType);
         protected abstract void WriteBoolean(bool val, string name);
@@ -87,9 +87,9 @@ namespace System.Runtime.Serialization
         System.Runtime.Serialization.SerializationBinder? Binder { get; set; }
         System.Runtime.Serialization.StreamingContext Context { get; set; }
         System.Runtime.Serialization.ISurrogateSelector? SurrogateSelector { get; set; }
-        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         object Deserialize(System.IO.Stream serializationStream);
-        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         void Serialize(System.IO.Stream serializationStream, object graph);
     }
     public partial interface ISerializationSurrogate
@@ -183,9 +183,9 @@ namespace System.Runtime.Serialization.Formatters.Binary
         public System.Runtime.Serialization.Formatters.TypeFilterLevel FilterLevel { get { throw null; } set { } }
         public System.Runtime.Serialization.ISurrogateSelector? SurrogateSelector { get { throw null; } set { } }
         public System.Runtime.Serialization.Formatters.FormatterTypeStyle TypeFormat { get { throw null; } set { } }
-        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public object Deserialize(System.IO.Stream serializationStream) { throw null; }
-        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+        [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public void Serialize(System.IO.Stream serializationStream, object graph) { }
     }
 }
index 9d66e01..6dd50fd 100644 (file)
@@ -30,7 +30,6 @@
     <Compile Include="System\Runtime\Serialization\MemberHolder.cs" />
     <Compile Include="System\Runtime\Serialization\ObjectIDGenerator.cs" />
     <Compile Include="System\Runtime\Serialization\ObjectManager.cs" />
-    <Compile Include="System\Runtime\Serialization\Obsoletions.cs" />
     <Compile Include="System\Runtime\Serialization\SerializationBinder.cs" />
     <Compile Include="System\Runtime\Serialization\SerializationEventsCache.cs" />
     <Compile Include="System\Runtime\Serialization\SerializationFieldInfo.cs" />
@@ -70,6 +69,8 @@
     <Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryObjectWriter.cs" />
     <Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryParser.cs" />
     <Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryUtilClasses.cs" />
+    <Compile Include="$(CommonPath)System\Obsoletions.cs"
+             Link="Common\System\Obsoletions.cs" />
     <Compile Include="$(CoreLibSharedDir)System\Collections\HashHelpers.cs"
              Link="Common\System\Collections\HashHelpers.cs" />
   </ItemGroup>
index 1fa2c68..5d97328 100644 (file)
@@ -20,7 +20,7 @@ namespace System.Runtime.Serialization
             m_idGenerator = new ObjectIDGenerator();
         }
 
-        [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public abstract object Deserialize(Stream serializationStream);
 
         protected virtual object? GetNext(out long objID)
@@ -60,7 +60,7 @@ namespace System.Runtime.Serialization
             return id;
         }
 
-        [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public abstract void Serialize(Stream serializationStream, object graph);
 
         protected abstract void WriteArray(object obj, string name, Type memberType);
index 9183902..95f281f 100644 (file)
@@ -7,7 +7,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
 {
     public sealed partial class BinaryFormatter : IFormatter
     {
-        [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public object Deserialize(Stream serializationStream)
         {
             // don't refactor the 'throw' into a helper method; linker will have difficulty trimming
@@ -52,7 +52,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             }
         }
 
-        [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public void Serialize(Stream serializationStream, object graph)
         {
             // don't refactor the 'throw' into a helper method; linker will have difficulty trimming
index 0a8bdd5..4d56dee 100644 (file)
@@ -7,11 +7,11 @@ namespace System.Runtime.Serialization.Formatters.Binary
 {
     public sealed partial class BinaryFormatter : IFormatter
     {
-        [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public object Deserialize(Stream serializationStream)
             => throw new PlatformNotSupportedException(SR.BinaryFormatter_SerializationDisallowed);
 
-        [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public void Serialize(Stream serializationStream, object graph)
             => throw new PlatformNotSupportedException(SR.BinaryFormatter_SerializationDisallowed);
     }
index 7fd7f9e..2d3e412 100644 (file)
@@ -7,9 +7,9 @@ namespace System.Runtime.Serialization
 {
     public interface IFormatter
     {
-        [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         object Deserialize(Stream serializationStream);
-        [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         void Serialize(Stream serializationStream, object graph);
         ISurrogateSelector? SurrogateSelector { get; set; }
         SerializationBinder? Binder { get; set; }
diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Obsoletions.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Obsoletions.cs
deleted file mode 100644 (file)
index 191d0fa..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Serialization
-{
-    internal static class Obsoletions
-    {
-        internal const string SharedUrlFormat = "https://aka.ms/dotnet-warnings/{0}";
-
-        internal const string InsecureSerializationMessage = "BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.";
-        internal const string InsecureSerializationDiagId = "MSLIB0003";
-    }
-}
index 6e3a44d..3e90992 100644 (file)
@@ -412,11 +412,13 @@ namespace System.Runtime.Serialization.Formatters.Tests
             var formatException = new FormatException("message", exception);
             yield return new object[] { PopulateException(formatException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uRm9ybWF0RXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAFlN5c3RlbS5Gb3JtYXRFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netcoreapp20), new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uRm9ybWF0RXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYCAAAAFlN5c3RlbS5Gb3JtYXRFeGNlcHRpb24GAwAAAAdtZXNzYWdlCQQAAAAJBQAAAAYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAEBQAAABBTeXN0ZW0uRXhjZXB0aW9uDAAAAAlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMBAQMDAQEBAAEAAQcpU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwQU3lzdGVtLkV4Y2VwdGlvbggIAgYLAAAAEFN5c3RlbS5FeGNlcHRpb24JAwAAAAkNAAAACQ4AAAAJBgAAAAkHAAAACQgAAAAAAAAACugDAAAJCQAAAAoECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGEwAAAAZzZWNyZXQIAQEJFAAAAAENAAAABAAAAAkVAAAAAgAAAAIAAAABDgAAAAUAAAAJCwAAAAYXAAAAF0lubmVyIGV4Y2VwdGlvbiBtZXNzYWdlCgoKCgoAAAAACgAVE4AKCgEUAAAACgAAAAgIAQAAAAYYAAAAA29uZQoBFQAAAAoAAAAJEwAAAAgBAQkaAAAAARoAAAAKAAAACAgBAAAACRgAAAAKCw==", TargetFrameworkMoniker.netfx461) } };
 
+#pragma warning disable SYSLIB0003 // Obsolete: CAS
             var hostProtectionException = new HostProtectionException("message", exception);
             yield return new object[] { PopulateException(hostProtectionException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAACdTeXN0ZW0uU2VjdXJpdHkuSG9zdFByb3RlY3Rpb25FeGNlcHRpb24OAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cxJQcm90ZWN0ZWRSZXNvdXJjZXMRRGVtYW5kZWRSZXNvdXJjZXMBAQMDAQEBAAEAAQcDAylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCMlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlMlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlBgIAAAAnU3lzdGVtLlNlY3VyaXR5Lkhvc3RQcm90ZWN0aW9uRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoE9v///zJTeXN0ZW0uU2VjdXJpdHkuUGVybWlzc2lvbnMuSG9zdFByb3RlY3Rpb25SZXNvdXJjZQEAAAAHdmFsdWVfXwAIAAAAAAH1////9v///wAAAAAEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJDAAAAAIAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDQAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDwAAAAkQAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAwAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhUAAAAGc2VjcmV0CAEBCRYAAAABDwAAAAQAAAAJFwAAAAIAAAACAAAAARAAAAAFAAAACQ0AAAAGGQAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFgAAAAwAAAAICAEAAAAGGgAAAANvbmUKARcAAAAMAAAACRUAAAAIAQEJHAAAAAEcAAAADAAAAAgIAQAAAAkaAAAACgs=", TargetFrameworkMoniker.netcoreapp20), new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAACdTeXN0ZW0uU2VjdXJpdHkuSG9zdFByb3RlY3Rpb25FeGNlcHRpb24OAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cxJQcm90ZWN0ZWRSZXNvdXJjZXMRRGVtYW5kZWRSZXNvdXJjZXMBAQMDAQEBAAEAAQcDAylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCMlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlMlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlBgIAAAAnU3lzdGVtLlNlY3VyaXR5Lkhvc3RQcm90ZWN0aW9uRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACQUAAAAGBgAAABlodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tBgcAAAAUU3RhY2tUcmFjZSBzdHJpbmcuLi4GCAAAABtSZW1vdGUgU3RhY2tUcmFjZSBzdHJpbmcuLi4AAAAACugDAAAGCQAAABdFeGNlcHRpb25fQ2xhc3NfU2FtcGxlcwoE9v///zJTeXN0ZW0uU2VjdXJpdHkuUGVybWlzc2lvbnMuSG9zdFByb3RlY3Rpb25SZXNvdXJjZQEAAAAHdmFsdWVfXwAIAAAAAAH1////9v///wAAAAAEBAAAAClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbAMAAAAEaGVhZAd2ZXJzaW9uBWNvdW50AwAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlCAgJDAAAAAIAAAACAAAABAUAAAAQU3lzdGVtLkV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGDQAAABBTeXN0ZW0uRXhjZXB0aW9uCQMAAAAJDwAAAAkQAAAACQYAAAAJBwAAAAkIAAAAAAAAAAroAwAACQkAAAAKBAwAAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUDAAAAA2tleQV2YWx1ZQRuZXh0AgIDOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlBhUAAAAGc2VjcmV0CAEBCRYAAAABDwAAAAQAAAAJFwAAAAIAAAACAAAAARAAAAAFAAAACQ0AAAAGGQAAABdJbm5lciBleGNlcHRpb24gbWVzc2FnZQoKCgoKAAAAAAoAFROACgoBFgAAAAwAAAAICAEAAAAGGgAAAANvbmUKARcAAAAMAAAACRUAAAAIAQEJHAAAAAEcAAAADAAAAAgIAQAAAAkaAAAACgs=", TargetFrameworkMoniker.netfx461) } };
 
             var hostProtectionException2 = new HostProtectionException("message", Security.Permissions.HostProtectionResource.All, Security.Permissions.HostProtectionResource.SharedState);
             yield return new object[] { PopulateException(hostProtectionException2, false), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAACdTeXN0ZW0uU2VjdXJpdHkuSG9zdFByb3RlY3Rpb25FeGNlcHRpb24OAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cxJQcm90ZWN0ZWRSZXNvdXJjZXMRRGVtYW5kZWRSZXNvdXJjZXMBAQMDAQEBAAEAAQcDAylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCMlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlMlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlBgIAAAAnU3lzdGVtLlNlY3VyaXR5Lkhvc3RQcm90ZWN0aW9uRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACgYFAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBgAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYHAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAKQBYTgAYIAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgT3////MlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlAQAAAAd2YWx1ZV9fAAj/AQAAAfb////3////AgAAAAQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkLAAAAAgAAAAIAAAAECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGDAAAAAZzZWNyZXQIAQEJDQAAAAENAAAACwAAAAgIAQAAAAYOAAAAA29uZQoL", TargetFrameworkMoniker.netcoreapp20), new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAACdTeXN0ZW0uU2VjdXJpdHkuSG9zdFByb3RlY3Rpb25FeGNlcHRpb24OAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cxJQcm90ZWN0ZWRSZXNvdXJjZXMRRGVtYW5kZWRSZXNvdXJjZXMBAQMDAQEBAAEAAQcDAylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCMlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlMlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlBgIAAAAnU3lzdGVtLlNlY3VyaXR5Lkhvc3RQcm90ZWN0aW9uRXhjZXB0aW9uBgMAAAAHbWVzc2FnZQkEAAAACgYFAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBgAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYHAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAKQBYTgAYIAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgT3////MlN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5Ib3N0UHJvdGVjdGlvblJlc291cmNlAQAAAAd2YWx1ZV9fAAj/AQAAAfb////3////AgAAAAQEAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkLAAAAAgAAAAIAAAAECwAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGDAAAAAZzZWNyZXQIAQEJDQAAAAENAAAACwAAAAgIAQAAAAYOAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) } };
+#pragma warning restore SYSLIB0003 // Obsolete: CAS
 
             var httpListenerException = new HttpListenerException(404, "not found");
             yield return new object[] { PopulateException(httpListenerException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAgU3lzdGVtLk5ldC5IdHRwTGlzdGVuZXJFeGNlcHRpb24NAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cw9OYXRpdmVFcnJvckNvZGUBAQMDAQEBAAEAAQcAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIIAgAAAAYDAAAAIFN5c3RlbS5OZXQuSHR0cExpc3RlbmVyRXhjZXB0aW9uBgQAAAAJbm90IGZvdW5kCQUAAAAKBgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKlAEAAAQFAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGCwAAAAZzZWNyZXQIAQEJDAAAAAEMAAAACgAAAAgIAQAAAAYNAAAAA29uZQoL", TargetFrameworkMoniker.netcoreapp20), new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAgU3lzdGVtLk5ldC5IdHRwTGlzdGVuZXJFeGNlcHRpb24NAAAAD05hdGl2ZUVycm9yQ29kZQlDbGFzc05hbWUHTWVzc2FnZQREYXRhDklubmVyRXhjZXB0aW9uB0hlbHBVUkwQU3RhY2tUcmFjZVN0cmluZxZSZW1vdGVTdGFja1RyYWNlU3RyaW5nEFJlbW90ZVN0YWNrSW5kZXgPRXhjZXB0aW9uTWV0aG9kB0hSZXN1bHQGU291cmNlDVdhdHNvbkJ1Y2tldHMAAQEDAwEBAQABAAEHCClTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCAgAAAJQBAAAGAwAAACBTeXN0ZW0uTmV0Lkh0dHBMaXN0ZW5lckV4Y2VwdGlvbgYEAAAACW5vdCBmb3VuZAkFAAAACgYGAAAAGWh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20GBwAAABRTdGFja1RyYWNlIHN0cmluZy4uLgYIAAAAG1JlbW90ZSBTdGFja1RyYWNlIHN0cmluZy4uLgAAAAAK6AMAAAYJAAAAF0V4Y2VwdGlvbl9DbGFzc19TYW1wbGVzCgQFAAAAKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsAwAAAARoZWFkB3ZlcnNpb24FY291bnQDAAA4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUICAkKAAAAAgAAAAIAAAAECgAAADhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQMAAAADa2V5BXZhbHVlBG5leHQCAgM4U3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwrRGljdGlvbmFyeU5vZGUGCwAAAAZzZWNyZXQIAQEJDAAAAAEMAAAACgAAAAgIAQAAAAYNAAAAA29uZQoL", TargetFrameworkMoniker.netfx461) } };
index b5fb711..447e65b 100644 (file)
@@ -124,6 +124,7 @@ namespace System
         public static long MonitoringSurvivedProcessMemorySize { get { throw null; } }
         public long MonitoringTotalAllocatedMemorySize { get { throw null; } }
         public System.TimeSpan MonitoringTotalProcessorTime { get { throw null; } }
+        [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public System.Security.PermissionSet PermissionSet { get { throw null; } }
         public string? RelativeSearchPath { get { throw null; } }
         public System.AppDomainSetup SetupInformation { get { throw null; } }
@@ -2629,7 +2630,9 @@ namespace System
     public abstract partial class MarshalByRefObject
     {
         protected MarshalByRefObject() { }
+        [System.ObsoleteAttribute("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0010", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public object GetLifetimeService() { throw null; }
+        [System.ObsoleteAttribute("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0010", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public virtual object InitializeLifetimeService() { throw null; }
         protected System.MarshalByRefObject MemberwiseClone(bool cloneIdentity) { throw null; }
     }
@@ -7563,6 +7566,7 @@ namespace System.Reflection
         public virtual string EscapedCodeBase { get { throw null; } }
         public virtual System.Collections.Generic.IEnumerable<System.Type> ExportedTypes { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")] get { throw null; } }
         public virtual string? FullName { get { throw null; } }
+        [System.ObsoleteAttribute("The Global Assembly Cache is not supported.", DiagnosticId = "SYSLIB0005", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public virtual bool GlobalAssemblyCache { get { throw null; } }
         public virtual long HostContext { get { throw null; } }
         public virtual string ImageRuntimeVersion { get { throw null; } }
@@ -9364,6 +9368,7 @@ namespace System.Runtime.CompilerServices
         public static System.IntPtr AllocateTypeAssociatedMemory(System.Type type, int size) { throw null; }
         public static void EnsureSufficientExecutionStack() { }
         public static new bool Equals(object? o1, object? o2) { throw null; }
+        [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static void ExecuteCodeWithGuaranteedCleanup(System.Runtime.CompilerServices.RuntimeHelpers.TryCode code, System.Runtime.CompilerServices.RuntimeHelpers.CleanupCode backoutCode, object? userData) { }
         public static int GetHashCode(object? o) { throw null; }
         [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("obj")]
@@ -9372,12 +9377,16 @@ namespace System.Runtime.CompilerServices
         public static object GetUninitializedObject([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type) { throw null; }
         public static void InitializeArray(System.Array array, System.RuntimeFieldHandle fldHandle) { }
         public static bool IsReferenceOrContainsReferences<T>() { throw null; }
+        [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static void PrepareConstrainedRegions() { }
+        [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static void PrepareConstrainedRegionsNoOP() { }
+        [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static void PrepareContractedDelegate(System.Delegate d) { }
         public static void PrepareDelegate(System.Delegate d) { }
         public static void PrepareMethod(System.RuntimeMethodHandle method) { }
         public static void PrepareMethod(System.RuntimeMethodHandle method, System.RuntimeTypeHandle[]? instantiation) { }
+        [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static void ProbeForSufficientStack() { }
         public static void RunClassConstructor(System.RuntimeTypeHandle type) { }
         public static void RunModuleConstructor(System.ModuleHandle module) { }
@@ -9510,12 +9519,14 @@ namespace System.Runtime.CompilerServices
 }
 namespace System.Runtime.ConstrainedExecution
 {
+    [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     public enum Cer
     {
         None = 0,
         MayFail = 1,
         Success = 2,
     }
+    [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     public enum Consistency
     {
         MayCorruptProcess = 0,
@@ -9528,11 +9539,13 @@ namespace System.Runtime.ConstrainedExecution
         protected CriticalFinalizerObject() { }
         ~CriticalFinalizerObject() { }
     }
+    [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     [System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
     public sealed partial class PrePrepareMethodAttribute : System.Attribute
     {
         public PrePrepareMethodAttribute() { }
     }
+    [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
     public sealed partial class ReliabilityContractAttribute : System.Attribute
     {
@@ -10000,6 +10013,7 @@ namespace System.Security
         public AllowPartiallyTrustedCallersAttribute() { }
         public System.Security.PartialTrustVisibilityLevel PartialTrustVisibilityLevel { get { throw null; } set { } }
     }
+    [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     public partial interface IPermission : System.Security.ISecurityEncodable
     {
         System.Security.IPermission Copy();
@@ -10013,6 +10027,7 @@ namespace System.Security
         void FromXml(System.Security.SecurityElement e);
         System.Security.SecurityElement? ToXml();
     }
+    [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     public partial interface IStackWalk
     {
         void Assert();
@@ -10025,6 +10040,7 @@ namespace System.Security
         VisibleToAllHosts = 0,
         NotVisibleByDefault = 1,
     }
+    [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     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) { }
@@ -10185,32 +10201,32 @@ namespace System.Security.Cryptography
 }
 namespace System.Security.Permissions
 {
+    [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
     public abstract partial class CodeAccessSecurityAttribute : System.Security.Permissions.SecurityAttribute
     {
         protected CodeAccessSecurityAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
     }
+    [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     public enum PermissionState
     {
         None = 0,
         Unrestricted = 1,
     }
+    [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     public enum SecurityAction
     {
         Demand = 2,
         Assert = 3,
-        [System.ObsoleteAttribute("Deny is obsolete and will be removed in a future release of the .NET Framework. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
         Deny = 4,
         PermitOnly = 5,
         LinkDemand = 6,
         InheritanceDemand = 7,
-        [System.ObsoleteAttribute("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
         RequestMinimum = 8,
-        [System.ObsoleteAttribute("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
         RequestOptional = 9,
-        [System.ObsoleteAttribute("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See https://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
         RequestRefuse = 10,
     }
+    [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
     public abstract partial class SecurityAttribute : System.Attribute
     {
@@ -10219,6 +10235,7 @@ namespace System.Security.Permissions
         public bool Unrestricted { get { throw null; } set { } }
         public abstract System.Security.IPermission? CreatePermission();
     }
+    [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
     public sealed partial class SecurityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -10240,6 +10257,7 @@ namespace System.Security.Permissions
         public bool UnmanagedCode { get { throw null; } set { } }
         public override System.Security.IPermission? CreatePermission() { throw null; }
     }
+    [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
     [System.FlagsAttribute]
     public enum SecurityPermissionFlag
     {
@@ -10482,7 +10500,7 @@ namespace System.Text
         public virtual System.ReadOnlySpan<byte> Preamble { get { throw null; } }
         public static System.Text.Encoding Unicode { get { throw null; } }
         public static System.Text.Encoding UTF32 { get { throw null; } }
-        [System.ObsoleteAttribute("The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.", DiagnosticId = "MSLIB0001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+        [System.ObsoleteAttribute("The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.", DiagnosticId = "SYSLIB0001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static System.Text.Encoding UTF7 { get { throw null; } }
         public static System.Text.Encoding UTF8 { get { throw null; } }
         public virtual string WebName { get { throw null; } }
index a48ef55..6fc54b9 100644 (file)
@@ -6,6 +6,7 @@ using Xunit;
 
 namespace System.Runtime.ConstrainedExecution.Tests
 {
+#pragma warning disable SYSLIB0004 // Obsolete: CER
     public class PrePrepareMethodAttributeTests
     {
         public sealed class ConstrainedType
@@ -34,4 +35,5 @@ namespace System.Runtime.ConstrainedExecution.Tests
                 typeof(ConstrainedType).GetConstructors()[0].GetCustomAttribute<PrePrepareMethodAttribute>());
         }
     }
+#pragma warning restore SYSLIB0004 // Obsolete: CER
 }
index 1678613..28be1b4 100644 (file)
@@ -10,9 +10,9 @@ namespace System.Text.Tests
 {
     public class EncodingTests
     {
-#pragma warning disable MSLIB0001 // UTF7Encoding is obsolete
+#pragma warning disable SYSLIB0001 // UTF7Encoding is obsolete
         private static UTF7Encoding _utf7Encoding = new UTF7Encoding();
-#pragma warning restore MSLIB0001
+#pragma warning restore SYSLIB0001
 
         public static IEnumerable<object[]> DisallowedEncodings()
         {
index 2fb1c06..355c6c2 100644 (file)
@@ -16,6 +16,7 @@ namespace System.Security.Cryptography
         public virtual System.Security.Cryptography.KeySizes[] LegalKeySizes { get { throw null; } }
         public virtual string? SignatureAlgorithm { get { throw null; } }
         public void Clear() { }
+        [System.ObsoleteAttribute("The default implementation of this cryptography algorithm is not supported", DiagnosticId = "SYSLIB0007", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static System.Security.Cryptography.AsymmetricAlgorithm Create() { throw null; }
         public static System.Security.Cryptography.AsymmetricAlgorithm? Create(string algName) { throw null; }
         public void Dispose() { }
@@ -112,6 +113,7 @@ namespace System.Security.Cryptography
         public byte[] ComputeHash(byte[] buffer, int offset, int count) { throw null; }
         public byte[] ComputeHash(System.IO.Stream inputStream) { throw null; }
         public System.Threading.Tasks.Task<byte[]> ComputeHashAsync(System.IO.Stream inputStream, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+        [System.ObsoleteAttribute("The default implementation of this cryptography algorithm is not supported", DiagnosticId = "SYSLIB0007", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static System.Security.Cryptography.HashAlgorithm Create() { throw null; }
         public static System.Security.Cryptography.HashAlgorithm? Create(string hashName) { throw null; }
         public void Dispose() { }
@@ -151,6 +153,7 @@ namespace System.Security.Cryptography
         protected int BlockSizeValue { get { throw null; } set { } }
         public string HashName { get { throw null; } set { } }
         public override byte[] Key { get { throw null; } set { } }
+        [System.ObsoleteAttribute("The default implementation of this cryptography algorithm is not supported", DiagnosticId = "SYSLIB0007", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static new System.Security.Cryptography.HMAC Create() { throw null; }
         public static new System.Security.Cryptography.HMAC? Create(string algorithmName) { throw null; }
         protected override void Dispose(bool disposing) { }
@@ -174,6 +177,7 @@ namespace System.Security.Cryptography
         protected byte[] KeyValue;
         protected KeyedHashAlgorithm() { }
         public virtual byte[] Key { get { throw null; } set { } }
+        [System.ObsoleteAttribute("The default implementation of this cryptography algorithm is not supported", DiagnosticId = "SYSLIB0007", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static new System.Security.Cryptography.KeyedHashAlgorithm Create() { throw null; }
         public static new System.Security.Cryptography.KeyedHashAlgorithm? Create(string algName) { throw null; }
         protected override void Dispose(bool disposing) { }
@@ -230,6 +234,7 @@ namespace System.Security.Cryptography
         public virtual System.Security.Cryptography.CipherMode Mode { get { throw null; } set { } }
         public virtual System.Security.Cryptography.PaddingMode Padding { get { throw null; } set { } }
         public void Clear() { }
+        [System.ObsoleteAttribute("The default implementation of this cryptography algorithm is not supported", DiagnosticId = "SYSLIB0007", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public static System.Security.Cryptography.SymmetricAlgorithm Create() { throw null; }
         public static System.Security.Cryptography.SymmetricAlgorithm? Create(string algName) { throw null; }
         public virtual System.Security.Cryptography.ICryptoTransform CreateDecryptor() { throw null; }
index 6a479c3..1d98480 100644 (file)
@@ -27,6 +27,8 @@
     <Compile Include="System\Security\Cryptography\PbeEncryptionAlgorithm.cs" />
     <Compile Include="System\Security\Cryptography\PbeParameters.cs" />
     <Compile Include="System\Security\Cryptography\SymmetricAlgorithm.cs" />
+    <Compile Include="$(CommonPath)System\Obsoletions.cs"
+             Link="Common\System\Obsoletions.cs" />
     <Compile Include="$(CommonPath)System\Threading\Tasks\ForceAsyncAwaiter.cs"
              Link="Common\System\Threading\Tasks\ForceAsyncAwaiter.cs" />
     <Compile Include="$(CommonPath)Internal\Cryptography\Helpers.cs"
index 2e2c159..c42ecd4 100644 (file)
@@ -13,6 +13,7 @@ namespace System.Security.Cryptography
 
         protected AsymmetricAlgorithm() { }
 
+        [Obsolete(Obsoletions.DefaultCryptoAlgorithmsMessage, DiagnosticId = Obsoletions.DefaultCryptoAlgorithmsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static AsymmetricAlgorithm Create() =>
             throw new PlatformNotSupportedException(SR.Cryptography_DefaultAlgorithm_NotSupported);
 
index 646f486..4268cd9 100644 (file)
@@ -16,6 +16,7 @@ namespace System.Security.Cryptography
 
         protected HMAC() { }
 
+        [Obsolete(Obsoletions.DefaultCryptoAlgorithmsMessage, DiagnosticId = Obsoletions.DefaultCryptoAlgorithmsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static new HMAC Create() =>
             throw new PlatformNotSupportedException(SR.Cryptography_DefaultAlgorithm_NotSupported);
 
index e953c84..31d64eb 100644 (file)
@@ -17,6 +17,7 @@ namespace System.Security.Cryptography
 
         protected HashAlgorithm() { }
 
+        [Obsolete(Obsoletions.DefaultCryptoAlgorithmsMessage, DiagnosticId = Obsoletions.DefaultCryptoAlgorithmsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static HashAlgorithm Create() =>
             CryptoConfigForwarder.CreateDefaultHashAlgorithm();
 
index 9237f48..2088346 100644 (file)
@@ -9,6 +9,7 @@ namespace System.Security.Cryptography
     {
         protected KeyedHashAlgorithm() { }
 
+        [Obsolete(Obsoletions.DefaultCryptoAlgorithmsMessage, DiagnosticId = Obsoletions.DefaultCryptoAlgorithmsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static new KeyedHashAlgorithm Create() =>
             throw new PlatformNotSupportedException(SR.Cryptography_DefaultAlgorithm_NotSupported);
 
index 1e0247c..8e16664 100644 (file)
@@ -15,6 +15,7 @@ namespace System.Security.Cryptography
             PaddingValue = PaddingMode.PKCS7;
         }
 
+        [Obsolete(Obsoletions.DefaultCryptoAlgorithmsMessage, DiagnosticId = Obsoletions.DefaultCryptoAlgorithmsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public static SymmetricAlgorithm Create() =>
             throw new PlatformNotSupportedException(SR.Cryptography_DefaultAlgorithm_NotSupported);
 
index 3184a8d..7dcdd65 100644 (file)
@@ -10,12 +10,14 @@ namespace System.Security.Cryptography.CryptoConfigTests
         [Fact]
         public static void DefaultStaticCreateMethods()
         {
+#pragma warning disable SYSLIB0007 // These methods are marked as Obsolete
             // .NET Core does not allow the base classes to pick an algorithm.
             Assert.Throws<PlatformNotSupportedException>(() => AsymmetricAlgorithm.Create());
             Assert.Throws<PlatformNotSupportedException>(() => HashAlgorithm.Create());
             Assert.Throws<PlatformNotSupportedException>(() => KeyedHashAlgorithm.Create());
             Assert.Throws<PlatformNotSupportedException>(() => HMAC.Create());
             Assert.Throws<PlatformNotSupportedException>(() => SymmetricAlgorithm.Create());
+#pragma warning restore SYSLIB0007
         }
 
         [Fact]
index 6346b1c..6e691f9 100644 (file)
@@ -3,6 +3,7 @@
 // ------------------------------------------------------------------------------
 // Changes to this file must follow the https://aka.ms/api-review process.
 // ------------------------------------------------------------------------------
+#pragma warning disable SYSLIB0003 // CAS Obsoletions
 
 [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.IPermission))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.ISecurityEncodable))]
index 1af660f..81c59db 100644 (file)
@@ -17,6 +17,9 @@ namespace System
 }
 namespace System.Configuration
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public ConfigurationPermission(System.Security.Permissions.PermissionState state) { }
@@ -29,6 +32,9 @@ namespace System.Configuration
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
     [System.AttributeUsageAttribute(System.AttributeTargets.All, AllowMultiple=true, Inherited=false)]
+#if NET50_OBSOLETIONS
+    [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 ConfigurationPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
         public ConfigurationPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
@@ -37,6 +43,9 @@ namespace System.Configuration
 }
 namespace System.Data.Common
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         protected DBDataPermission() { }
@@ -56,6 +65,9 @@ namespace System.Data.Common
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public abstract partial class DBDataPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -72,6 +84,9 @@ namespace System.Data.Common
 }
 namespace System.Data.Odbc
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public OdbcPermission() { }
@@ -80,6 +95,9 @@ namespace System.Data.Odbc
         public override void Add(string connectionString, string restrictions, System.Data.KeyRestrictionBehavior behavior) { }
         public override System.Security.IPermission Copy() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class OdbcPermissionAttribute : System.Data.Common.DBDataPermissionAttribute
     {
@@ -89,6 +107,9 @@ namespace System.Data.Odbc
 }
 namespace System.Data.OleDb
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public OleDbPermission() { }
@@ -99,6 +120,9 @@ namespace System.Data.OleDb
         public string Provider { get { throw null; } set { } }
         public override System.Security.IPermission Copy() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class OleDbPermissionAttribute : System.Data.Common.DBDataPermissionAttribute
     {
@@ -111,6 +135,9 @@ namespace System.Data.OleDb
 }
 namespace System.Data.OracleClient
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public OraclePermission(System.Security.Permissions.PermissionState state) { }
@@ -124,6 +151,9 @@ namespace System.Data.OracleClient
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class OraclePermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -141,6 +171,9 @@ namespace System.Data.OracleClient
 }
 namespace System.Data.SqlClient
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public SqlClientPermission() { }
@@ -149,6 +182,9 @@ namespace System.Data.SqlClient
         public override void Add(string connectionString, string restrictions, System.Data.KeyRestrictionBehavior behavior) { }
         public override System.Security.IPermission Copy() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class SqlClientPermissionAttribute : System.Data.Common.DBDataPermissionAttribute
     {
@@ -158,6 +194,9 @@ namespace System.Data.SqlClient
 }
 namespace System.Diagnostics
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public EventLogPermission() { }
@@ -176,6 +215,9 @@ namespace System.Diagnostics
         Write = 16,
         Administer = 48,
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public partial class EventLogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -207,6 +249,9 @@ namespace System.Diagnostics
         protected override void OnSet(int index, object oldValue, object newValue) { }
         public void Remove(System.Diagnostics.EventLogPermissionEntry value) { }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public PerformanceCounterPermission() { }
@@ -225,6 +270,9 @@ namespace System.Diagnostics
         Instrument = 3,
         Administer = 7,
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public partial class PerformanceCounterPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -261,6 +309,9 @@ namespace System.Diagnostics
 }
 namespace System.Drawing.Printing
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public PrintingPermission(System.Drawing.Printing.PrintingPermissionLevel printingLevel) { }
@@ -274,6 +325,9 @@ namespace System.Drawing.Printing
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class PrintingPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -291,6 +345,9 @@ namespace System.Drawing.Printing
 }
 namespace System.Net
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public DnsPermission(System.Security.Permissions.PermissionState state) { }
@@ -302,6 +359,9 @@ namespace System.Net
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class DnsPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -323,6 +383,9 @@ namespace System.Net
         Connect = 64,
         Accept = 128,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public const int AllPorts = -1;
@@ -340,6 +403,9 @@ namespace System.Net
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
     [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
+#if NET50_OBSOLETIONS
+    [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 SocketPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
         public SocketPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
@@ -357,6 +423,9 @@ namespace System.Net
         Tcp = 2,
         All = 3,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public WebPermission() { }
@@ -376,6 +445,9 @@ namespace System.Net
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
     [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
+#if NET50_OBSOLETIONS
+    [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 WebPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
         public WebPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
@@ -394,6 +466,9 @@ namespace System.Net.Mail
         Connect = 1,
         ConnectToUnrestrictedPort = 2,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public SmtpPermission(bool unrestricted) { }
@@ -409,6 +484,9 @@ namespace System.Net.Mail
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class SmtpPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -426,6 +504,9 @@ namespace System.Net.NetworkInformation
         Read = 1,
         Ping = 4,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public NetworkInformationPermission(System.Net.NetworkInformation.NetworkInformationAccess access) { }
@@ -440,6 +521,9 @@ namespace System.Net.NetworkInformation
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class NetworkInformationPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -450,6 +534,9 @@ namespace System.Net.NetworkInformation
 }
 namespace System.Net.PeerToPeer
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public PnrpPermission(System.Security.Permissions.PermissionState state) { }
@@ -461,6 +548,9 @@ namespace System.Net.PeerToPeer
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class PnrpPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -477,6 +567,9 @@ namespace System.Net.PeerToPeer
 }
 namespace System.Net.PeerToPeer.Collaboration
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public PeerCollaborationPermission(System.Security.Permissions.PermissionState state) { }
@@ -488,6 +581,9 @@ namespace System.Net.PeerToPeer.Collaboration
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class PeerCollaborationPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -497,6 +593,9 @@ namespace System.Net.PeerToPeer.Collaboration
 }
 namespace System.Security
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         protected CodeAccessPermission() { }
@@ -520,6 +619,9 @@ namespace System.Security
         public abstract System.Security.SecurityElement ToXml();
         public virtual System.Security.IPermission Union(System.Security.IPermission other) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public HostProtectionException() { }
@@ -575,6 +677,9 @@ namespace System.Security
         void PermitOnly();
     }
 #endif
+#if NET50_OBSOLETIONS
+    [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
     {
         public NamedPermissionSet(System.Security.NamedPermissionSet permSet) : base (default(System.Security.Permissions.PermissionState)) { }
@@ -658,6 +763,9 @@ namespace System.Security
         CurrentAppDomain = 0,
         CurrentAssembly = 1,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         [System.ObsoleteAttribute]
@@ -716,6 +824,9 @@ namespace System.Security
 }
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public DataProtectionPermission(System.Security.Permissions.DataProtectionPermissionFlags flag) { }
@@ -729,6 +840,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class DataProtectionPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -740,6 +854,9 @@ namespace System.Security.Permissions
         public bool UnprotectMemory { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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]
     public enum DataProtectionPermissionFlags
     {
@@ -750,6 +867,9 @@ namespace System.Security.Permissions
         UnprotectMemory = 8,
         AllFlags = 15,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public EnvironmentPermission(System.Security.Permissions.EnvironmentPermissionAccess flag, string pathList) { }
@@ -766,6 +886,9 @@ namespace System.Security.Permissions
         public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; }
     }
     [System.FlagsAttribute]
+#if NET50_OBSOLETIONS
+    [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 EnvironmentPermissionAccess
     {
         NoAccess = 0,
@@ -774,6 +897,9 @@ namespace System.Security.Permissions
         AllAccess = 3,
     }
     [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
+#if NET50_OBSOLETIONS
+    [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 EnvironmentPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
         public EnvironmentPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
@@ -782,6 +908,9 @@ namespace System.Security.Permissions
         public string Write { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public FileDialogPermission(System.Security.Permissions.FileDialogPermissionAccess access) { }
@@ -795,6 +924,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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]
     public enum FileDialogPermissionAccess
     {
@@ -803,6 +935,9 @@ namespace System.Security.Permissions
         Save = 2,
         OpenSave = 3,
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class FileDialogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -811,6 +946,9 @@ namespace System.Security.Permissions
         public bool Save { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public FileIOPermission(System.Security.Permissions.FileIOPermissionAccess access, System.Security.AccessControl.AccessControlActions actions, string path) { }
@@ -835,6 +973,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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]
     public enum FileIOPermissionAccess
     {
@@ -845,6 +986,9 @@ namespace System.Security.Permissions
         PathDiscovery = 8,
         AllAccess = 15,
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class FileIOPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -862,6 +1006,9 @@ namespace System.Security.Permissions
         public string Write { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public GacIdentityPermission() { }
@@ -873,12 +1020,18 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class GacIdentityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
         public GacIdentityPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class HostProtectionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -896,6 +1049,9 @@ namespace System.Security.Permissions
         public bool UI { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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]
     public enum HostProtectionResource
     {
@@ -911,6 +1067,9 @@ namespace System.Security.Permissions
         MayLeakOnAbort = 256,
         All = 511,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         None = 0,
@@ -926,6 +1085,9 @@ namespace System.Security.Permissions
         AdministerIsolatedStorageByUser = 112,
         UnrestrictedIsolatedStorage = 240,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public IsolatedStorageFilePermission(System.Security.Permissions.PermissionState state) : base (default(System.Security.Permissions.PermissionState)) { }
@@ -935,12 +1097,18 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class IsolatedStorageFilePermissionAttribute : System.Security.Permissions.IsolatedStoragePermissionAttribute
     {
         public IsolatedStorageFilePermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         protected IsolatedStoragePermission(System.Security.Permissions.PermissionState state) { }
@@ -950,16 +1118,25 @@ namespace System.Security.Permissions
         public bool IsUnrestricted() { throw null; }
         public override System.Security.SecurityElement ToXml() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         protected IsolatedStoragePermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
         public System.Security.Permissions.IsolatedStorageContainment UsageAllowed { get { throw null; } set { } }
         public long UserQuota { get { throw null; } set { } }
     }
+#if NET50_OBSOLETIONS
+    [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 NET50_OBSOLETIONS
+    [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
     {
         public KeyContainerPermission(System.Security.Permissions.KeyContainerPermissionFlags flags) { }
@@ -975,6 +1152,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public KeyContainerPermissionAccessEntry(System.Security.Cryptography.CspParameters parameters, System.Security.Permissions.KeyContainerPermissionFlags flags) { }
@@ -989,6 +1169,9 @@ namespace System.Security.Permissions
         public override bool Equals(object o) { throw null; }
         public override int GetHashCode() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public KeyContainerPermissionAccessEntryCollection() { }
@@ -1005,6 +1188,9 @@ namespace System.Security.Permissions
         public void Remove(System.Security.Permissions.KeyContainerPermissionAccessEntry accessEntry) { }
         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public KeyContainerPermissionAccessEntryEnumerator() { }
@@ -1014,6 +1200,9 @@ namespace System.Security.Permissions
         public void Reset() { }
     }
     [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
+#if NET50_OBSOLETIONS
+    [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 KeyContainerPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
         public KeyContainerPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
@@ -1025,6 +1214,9 @@ namespace System.Security.Permissions
         public int ProviderType { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         NoFlags = 0,
@@ -1039,6 +1231,9 @@ namespace System.Security.Permissions
         ChangeAcl = 8192,
         AllFlags = 13111,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public MediaPermission() { }
@@ -1059,6 +1254,9 @@ namespace System.Security.Permissions
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
     [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
+#if NET50_OBSOLETIONS
+    [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 MediaPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
         public MediaPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
@@ -1067,6 +1265,9 @@ namespace System.Security.Permissions
         public System.Security.Permissions.MediaPermissionVideo Video { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         NoAudio = 0,
@@ -1074,6 +1275,9 @@ namespace System.Security.Permissions
         SafeAudio = 2,
         AllAudio = 3,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         NoImage = 0,
@@ -1081,6 +1285,9 @@ namespace System.Security.Permissions
         SafeImage = 2,
         AllImage = 3,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         NoVideo = 0,
@@ -1088,6 +1295,9 @@ namespace System.Security.Permissions
         SafeVideo = 2,
         AllVideo = 3,
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class PermissionSetAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1107,6 +1317,9 @@ namespace System.Security.Permissions
         Unrestricted = 1,
     }
 #endif
+#if NET50_OBSOLETIONS
+    [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
     {
         public PrincipalPermission(System.Security.Permissions.PermissionState state) { }
@@ -1125,10 +1338,13 @@ namespace System.Security.Permissions
         public System.Security.IPermission Union(System.Security.IPermission other) { throw null; }
     }
     [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
+#if NET50_OBSOLETIONS
+    [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 PrincipalPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
-#if CAS_OBSOLETIONS
-        [System.ObsoleteAttribute("PrincipalPermissionAttribute is not honored by the runtime and must not be used.", true, DiagnosticId = "MSLIB0002", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+#if NET50_OBSOLETIONS
+        [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)) { }
         public bool Authenticated { get { throw null; } set { } }
@@ -1136,6 +1352,9 @@ namespace System.Security.Permissions
         public string Role { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public PublisherIdentityPermission(System.Security.Cryptography.X509Certificates.X509Certificate certificate) { }
@@ -1148,6 +1367,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class PublisherIdentityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1157,6 +1379,9 @@ namespace System.Security.Permissions
         public string X509Certificate { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public ReflectionPermission(System.Security.Permissions.PermissionState state) { }
@@ -1170,6 +1395,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class ReflectionPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1183,6 +1411,9 @@ namespace System.Security.Permissions
         public bool TypeInformation { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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]
     public enum ReflectionPermissionFlag
     {
@@ -1196,6 +1427,9 @@ namespace System.Security.Permissions
         AllFlags = 7,
         RestrictedMemberAccess = 8,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public RegistryPermission(System.Security.Permissions.PermissionState state) { }
@@ -1213,6 +1447,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission other) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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]
     public enum RegistryPermissionAccess
     {
@@ -1222,6 +1459,9 @@ namespace System.Security.Permissions
         Create = 4,
         AllAccess = 7,
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class RegistryPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1236,6 +1476,9 @@ namespace System.Security.Permissions
         public string Write { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public const string Any = "*";
@@ -1256,6 +1499,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public ResourcePermissionBaseEntry() { }
@@ -1263,6 +1509,9 @@ namespace System.Security.Permissions
         public int PermissionAccess { get { throw null; } }
         public string[] PermissionAccessPath { get { throw null; } }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public SecurityPermission(System.Security.Permissions.PermissionState state) { }
@@ -1276,6 +1525,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public SiteIdentityPermission(System.Security.Permissions.PermissionState state) { }
@@ -1288,6 +1540,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class SiteIdentityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1295,6 +1550,9 @@ namespace System.Security.Permissions
         public string Site { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public StorePermission(System.Security.Permissions.PermissionState state) { }
@@ -1308,6 +1566,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class StorePermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1322,6 +1583,9 @@ namespace System.Security.Permissions
         public bool RemoveFromStore { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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]
     public enum StorePermissionFlags
     {
@@ -1335,6 +1599,9 @@ namespace System.Security.Permissions
         EnumerateCertificates = 128,
         AllFlags = 247,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public StrongNameIdentityPermission(System.Security.Permissions.PermissionState state) { }
@@ -1349,6 +1616,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class StrongNameIdentityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1358,6 +1628,9 @@ namespace System.Security.Permissions
         public string Version { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public StrongNamePublicKeyBlob(byte[] publicKey) { }
@@ -1365,6 +1638,9 @@ namespace System.Security.Permissions
         public override int GetHashCode() { throw null; }
         public override string ToString() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public TypeDescriptorPermission(System.Security.Permissions.PermissionState state) { }
@@ -1378,6 +1654,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class TypeDescriptorPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1386,12 +1665,18 @@ namespace System.Security.Permissions
         public bool RestrictedRegistrationAccess { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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]
     public enum TypeDescriptorPermissionFlags
     {
         NoFlags = 0,
         RestrictedRegistrationAccess = 1,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public UIPermission(System.Security.Permissions.PermissionState state) { }
@@ -1408,6 +1693,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class UIPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1416,12 +1704,18 @@ namespace System.Security.Permissions
         public System.Security.Permissions.UIPermissionWindow Window { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         NoClipboard = 0,
         OwnClipboard = 1,
         AllClipboard = 2,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         NoWindows = 0,
@@ -1429,6 +1723,9 @@ namespace System.Security.Permissions
         SafeTopLevelWindows = 2,
         AllWindows = 3,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public UrlIdentityPermission(System.Security.Permissions.PermissionState state) { }
@@ -1441,6 +1738,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class UrlIdentityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1448,6 +1748,9 @@ namespace System.Security.Permissions
         public string Url { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public WebBrowserPermission() { }
@@ -1462,6 +1765,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class WebBrowserPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1469,12 +1775,18 @@ namespace System.Security.Permissions
         public System.Security.Permissions.WebBrowserPermissionLevel Level { get { throw null; } set { } }
         public override System.Security.IPermission CreatePermission() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         None = 0,
         Safe = 1,
         Unrestricted = 2,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public ZoneIdentityPermission(System.Security.Permissions.PermissionState state) { }
@@ -1487,6 +1799,9 @@ namespace System.Security.Permissions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class ZoneIdentityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -1536,10 +1851,16 @@ namespace System.Security.Policy
     {
         public ApplicationTrust() { }
         public ApplicationTrust(System.ApplicationIdentity identity) { }
+#if NET50_OBSOLETIONS
+        [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<System.Security.Policy.StrongName> 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 NET50_OBSOLETIONS
+        [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<System.Security.Policy.StrongName> FullTrustAssemblies { get { throw null; } }
         public bool IsApplicationTrustedToRun { get { throw null; } set { } }
         public bool Persist { get { throw null; } set { } }
@@ -1658,6 +1979,9 @@ namespace System.Security.Policy
         protected EvidenceBase() { }
         public virtual System.Security.Policy.EvidenceBase Clone() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public FileCodeGroup(System.Security.Policy.IMembershipCondition membershipCondition, System.Security.Permissions.FileIOPermissionAccess access) : base (default(System.Security.Policy.IMembershipCondition), default(System.Security.Policy.PolicyStatement)) { }
@@ -1681,6 +2005,9 @@ namespace System.Security.Policy
         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 NET50_OBSOLETIONS
+    [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
     {
         public GacInstalled() { }
@@ -1733,6 +2060,9 @@ namespace System.Security.Policy
         public System.Security.SecurityElement ToXml() { throw null; }
         public System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         System.Security.IPermission CreateIdentityPermission(System.Security.Policy.Evidence evidence);
@@ -1794,18 +2124,33 @@ namespace System.Security.Policy
         public void AddFullTrustAssembly(System.Security.Policy.StrongName sn) { }
         [System.ObsoleteAttribute]
         public void AddFullTrustAssembly(System.Security.Policy.StrongNameMembershipCondition snMC) { }
+#if NET50_OBSOLETIONS
+        [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 NET50_OBSOLETIONS
+        [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 NET50_OBSOLETIONS
+        [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; }
         public void Recover() { }
         [System.ObsoleteAttribute]
         public void RemoveFullTrustAssembly(System.Security.Policy.StrongName sn) { }
         [System.ObsoleteAttribute]
         public void RemoveFullTrustAssembly(System.Security.Policy.StrongNameMembershipCondition snMC) { }
+#if NET50_OBSOLETIONS
+        [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 NET50_OBSOLETIONS
+        [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; }
         public void Reset() { }
         public System.Security.Policy.PolicyStatement Resolve(System.Security.Policy.Evidence evidence) { throw null; }
@@ -1814,10 +2159,19 @@ namespace System.Security.Policy
     }
     public sealed partial class PolicyStatement : System.Security.ISecurityEncodable, System.Security.ISecurityPolicyEncodable
     {
+#if NET50_OBSOLETIONS
+        [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 NET50_OBSOLETIONS
+        [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 NET50_OBSOLETIONS
+        [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 { } }
         public System.Security.Policy.PolicyStatement Copy() { throw null; }
         public override bool Equals(object o) { throw null; }
@@ -1835,6 +2189,9 @@ namespace System.Security.Policy
         LevelFinal = 2,
         All = 3,
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public Publisher(System.Security.Cryptography.X509Certificates.X509Certificate cert) { }
@@ -1859,6 +2216,9 @@ namespace System.Security.Policy
         public System.Security.SecurityElement ToXml() { throw null; }
         public System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public Site(string name) { }
@@ -1884,6 +2244,9 @@ namespace System.Security.Policy
         public System.Security.SecurityElement ToXml() { throw null; }
         public System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public StrongName(System.Security.Permissions.StrongNamePublicKeyBlob blob, string name, System.Version version) { }
@@ -1896,6 +2259,9 @@ namespace System.Security.Policy
         public override int GetHashCode() { throw null; }
         public override string ToString() { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public StrongNameMembershipCondition(System.Security.Permissions.StrongNamePublicKeyBlob blob, string name, System.Version version) { }
@@ -1938,6 +2304,9 @@ namespace System.Security.Policy
         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 NET50_OBSOLETIONS
+    [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
     {
         public Url(string name) { }
@@ -1962,6 +2331,9 @@ namespace System.Security.Policy
         public System.Security.SecurityElement ToXml() { throw null; }
         public System.Security.SecurityElement ToXml(System.Security.Policy.PolicyLevel level) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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
     {
         public Zone(System.Security.SecurityZone zone) { }
@@ -1990,6 +2362,9 @@ namespace System.Security.Policy
 }
 namespace System.ServiceProcess
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public ServiceControllerPermission() { }
@@ -2005,7 +2380,10 @@ namespace System.ServiceProcess
         Browse = 2,
         Control = 6,
     }
-    [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
+#if NET50_OBSOLETIONS
+    [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)]
     public partial class ServiceControllerPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
         public ServiceControllerPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
@@ -2042,6 +2420,9 @@ namespace System.ServiceProcess
 }
 namespace System.Transactions
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public DistributedTransactionPermission(System.Security.Permissions.PermissionState state) { }
@@ -2053,6 +2434,9 @@ namespace System.Transactions
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class DistributedTransactionPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
@@ -2063,6 +2447,9 @@ namespace System.Transactions
 }
 namespace System.Web
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public AspNetHostingPermission(System.Security.Permissions.PermissionState state) { }
@@ -2076,6 +2463,9 @@ namespace System.Web
         public override System.Security.SecurityElement ToXml() { throw null; }
         public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
     }
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed partial class AspNetHostingPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
     {
index ec7d4c4..9905b31 100644 (file)
@@ -7,8 +7,9 @@
   <PropertyGroup>
     <IsPartialFacadeAssembly Condition="$(TargetFramework.StartsWith('net4'))">true</IsPartialFacadeAssembly>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
-    <DefineConstants>$(DefineConstants);CAS_OBSOLETIONS</DefineConstants>
+  <!-- We conditionally apply net5.0+ obsoletions -->
+  <PropertyGroup Condition="!($(TargetFramework.StartsWith('netcoreapp')) or $(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('net4')))">
+    <DefineConstants>$(DefineConstants);NET50_OBSOLETIONS</DefineConstants>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="System.Security.Permissions.cs" />
index cde0b3a..6de1351 100644 (file)
@@ -6,6 +6,9 @@
 
 namespace System.Xaml.Permissions
 {
+#if NET50_OBSOLETIONS
+    [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
     {
         public XamlLoadPermission(System.Collections.Generic.IEnumerable<System.Xaml.Permissions.XamlAccessLevel> allowedAccess) { }
index ab56a60..2658799 100644 (file)
@@ -4,8 +4,9 @@
     <TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.0;netstandard2.0;net461;$(NetFrameworkCurrent)</TargetFrameworks>
     <ExcludeCurrentFullFrameworkFromPackage>true</ExcludeCurrentFullFrameworkFromPackage>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
-    <DefineConstants>$(DefineConstants);CAS_OBSOLETIONS</DefineConstants>
+  <!-- We conditionally apply net5.0+ obsoletions -->
+  <PropertyGroup Condition="!($(TargetFramework.StartsWith('netcoreapp')) or $(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('net4')))">
+    <DefineConstants>$(DefineConstants);NET50_OBSOLETIONS</DefineConstants>
   </PropertyGroup>
   <ItemGroup Condition="!$(TargetFramework.StartsWith('net4'))">
     <Compile Include="System\ApplicationIdentity.cs" />
     <Compile Include="System\Web\AspNetHostingPermission.cs" />
     <Compile Include="System\Web\AspNetHostingPermissionAttribute.cs" />
     <Compile Include="System\Web\AspNetHostingPermissionLevel.cs" />
+    <Compile Include="$(CommonPath)System\Obsoletions.cs"
+             Link="Common\System\Obsoletions.cs" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)' or '$(TargetFramework)' == 'netcoreapp3.0'">
     <Compile Include="System\Xaml\Permissions\XamlLoadPermission.cs" />
index 1a08752..698fc4b 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Configuration
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class ConfigurationPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public ConfigurationPermission(PermissionState state) { }
index 74ecdb3..d6d97f1 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Data.Common
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public abstract class DBDataPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         protected DBDataPermission() { }
index 85b9664..34a7312 100644 (file)
@@ -7,6 +7,9 @@ using System.Security.Permissions;
 
 namespace System.Data.Odbc
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class OdbcPermission : DBDataPermission
     {
         public OdbcPermission() : base(default(PermissionState)) { }
index c55dce6..f5ccf47 100644 (file)
@@ -7,6 +7,9 @@ using System.Security.Permissions;
 
 namespace System.Data.OleDb
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class OleDbPermission : DBDataPermission
     {
         public OleDbPermission() : base(default(PermissionState)) { }
index 362f11f..e870d68 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Data.OracleClient
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class OraclePermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public OraclePermission(PermissionState state) { }
index fce107c..694c766 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Data.SqlClient
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class SqlClientPermission : DBDataPermission
     {
         public SqlClientPermission() : base(default(PermissionState)) { }
index ae89e63..3ed45ce 100644 (file)
@@ -5,6 +5,9 @@ using System.Security.Permissions;
 
 namespace System.Diagnostics
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class EventLogPermission : ResourcePermissionBase
     {
         public EventLogPermission() { }
index b50cead..3839ef6 100644 (file)
@@ -5,6 +5,9 @@ using System.Security.Permissions;
 
 namespace System.Diagnostics
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class PerformanceCounterPermission : ResourcePermissionBase
     {
         public PerformanceCounterPermission() { }
index 48de303..88c39a8 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Drawing.Printing
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class PrintingPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public PrintingPermission(PrintingPermissionLevel printingLevel) { }
index acfaeb3..8440027 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Net
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class DnsPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public DnsPermission(PermissionState state) { }
index 32419db..42fbd37 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Net.Mail
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class SmtpPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public SmtpPermission(bool unrestricted) { }
index a533d82..9b44611 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Net.NetworkInformation
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class NetworkInformationPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public NetworkInformationPermission(PermissionState state) { }
index 96a54d4..f43323a 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Net.PeerToPeer.Collaboration
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class PeerCollaborationPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public PeerCollaborationPermission(PermissionState state) { }
index cc00254..fe5bbc5 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Net.PeerToPeer
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class PnrpPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public PnrpPermission(PermissionState state) { }
index d99a674..1ec9ec6 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Net
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class SocketPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public const int AllPorts = -1;
index 0ad4045..b09aa99 100644 (file)
@@ -8,6 +8,9 @@ using System.Text.RegularExpressions;
 
 namespace System.Net
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class WebPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public WebPermission() { }
index 04fdb65..a6f2925 100644 (file)
@@ -7,6 +7,9 @@ using System.Text;
 
 namespace System.Security
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Serializable]
     [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
     public partial class HostProtectionException : SystemException
index 8f9b34f..0742f93 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class DataProtectionPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public DataProtectionPermission(PermissionState state) { }
index a78faa3..e746711 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [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 )]
     public sealed class DataProtectionPermissionAttribute : CodeAccessSecurityAttribute
index c057296..f0d525b 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Flags]
     public enum DataProtectionPermissionFlags
     {
index 40c1f21..573b37e 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class EnvironmentPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public EnvironmentPermission(EnvironmentPermissionAccess flag, string pathList) { }
index 44a757a..6ec356b 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Flags]
     public enum EnvironmentPermissionAccess
     {
index fdb27ad..a7998d5 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class EnvironmentPermissionAttribute : CodeAccessSecurityAttribute
     {
index 6f8c374..c63ed94 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class FileDialogPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public FileDialogPermission(FileDialogPermissionAccess access) { }
index d1419bd..2e185c7 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Flags]
     public enum FileDialogPermissionAccess
     {
index 065d370..d1b6160 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class FileDialogPermissionAttribute : CodeAccessSecurityAttribute
     {
index 60797f4..254efa3 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class FileIOPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public FileIOPermission(FileIOPermissionAccess access, string path) { }
index d1301d4..b37d2dc 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Flags]
     public enum FileIOPermissionAccess
     {
index e64b0cf..bbbf4eb 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed class FileIOPermissionAttribute : CodeAccessSecurityAttribute
     {
index dd75404..7f2daee 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class GacIdentityPermission : CodeAccessPermission
     {
         public GacIdentityPermission() { }
index cdf3ec1..716728e 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class GacIdentityPermissionAttribute : CodeAccessSecurityAttribute
     {
index adf3a3f..2c5fc1e 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(4205), AllowMultiple = true, Inherited = false)]
     public sealed partial class HostProtectionAttribute : CodeAccessSecurityAttribute
     {
index 25381f2..312a6ce 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Flags]
     [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
     public enum HostProtectionResource
index 2262f51..cad91be 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public partial interface IUnrestrictedPermission
     {
         bool IsUnrestricted();
index 6e97b04..eb6bd1c 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public enum IsolatedStorageContainment
     {
         None = 0x00,
index 72185df..755b25d 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class IsolatedStorageFilePermission : IsolatedStoragePermission
     {
         public IsolatedStorageFilePermission(PermissionState state) : base(state) { }
index 4021901..f103e65 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [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)]
index 71f149e..b0d9cc5 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public abstract class IsolatedStoragePermission : CodeAccessPermission, IUnrestrictedPermission
     {
         protected IsolatedStoragePermission(PermissionState state) { }
index 0afa273..254d193 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public abstract class IsolatedStoragePermissionAttribute : CodeAccessSecurityAttribute
     {
         protected IsolatedStoragePermissionAttribute(SecurityAction action) : base(action) { }
index 05e33c0..eb4e5f9 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class KeyContainerPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public KeyContainerPermission(PermissionState state) { }
index 836105c..6a7de83 100644 (file)
@@ -5,6 +5,9 @@ using System.Security.Cryptography;
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class KeyContainerPermissionAccessEntry
     {
         public KeyContainerPermissionAccessEntry(string keyContainerName, KeyContainerPermissionFlags flags) { }
index 7e34685..37362d2 100644 (file)
@@ -5,6 +5,9 @@ using System.Collections;
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class KeyContainerPermissionAccessEntryCollection : ICollection
     {
         public KeyContainerPermissionAccessEntry this[int index] { get { return null; } }
index fbacdef..453352a 100644 (file)
@@ -5,6 +5,9 @@ using System.Collections;
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class KeyContainerPermissionAccessEntryEnumerator : IEnumerator
     {
         public KeyContainerPermissionAccessEntry Current { get; }
index 31021ac..a80318d 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed class KeyContainerPermissionAttribute : CodeAccessSecurityAttribute
     {
index a802cb5..c6ec636 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public enum KeyContainerPermissionFlags
     {
         NoFlags = 0x0000,
index 8126aaf..e1112f0 100644 (file)
@@ -2,6 +2,9 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public enum MediaPermissionAudio
     {
         NoAudio,
@@ -9,6 +12,10 @@ namespace System.Security.Permissions
         SafeAudio,
         AllAudio
     }
+
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public enum MediaPermissionVideo
     {
         NoVideo,
@@ -16,6 +23,10 @@ namespace System.Security.Permissions
         SafeVideo,
         AllVideo,
     }
+
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public enum MediaPermissionImage
     {
         NoImage,
@@ -23,6 +34,10 @@ namespace System.Security.Permissions
         SafeImage,
         AllImage,
     }
+
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class MediaPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public MediaPermission() { }
@@ -45,6 +60,10 @@ namespace System.Security.Permissions
         public MediaPermissionVideo Video { get { return MediaPermissionVideo.AllVideo; } }
         public MediaPermissionImage Image { get { return MediaPermissionImage.AllImage; } }
     }
+
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed class MediaPermissionAttribute : CodeAccessSecurityAttribute
     {
index 1d32c7e..a03d56d 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class PermissionSetAttribute : CodeAccessSecurityAttribute
     {
index e11b21b..c1379d1 100644 (file)
@@ -8,6 +8,9 @@ using System.Threading;
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class PrincipalPermission : IPermission, ISecurityEncodable, IUnrestrictedPermission
     {
         private IDRole[] _idArray;
index 8cbc85a..6d90b43 100644 (file)
@@ -3,11 +3,14 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(68), AllowMultiple = true, Inherited = false)]
     public sealed partial class PrincipalPermissionAttribute : CodeAccessSecurityAttribute
     {
-#if CAS_OBSOLETIONS
-        [Obsolete("PrincipalPermissionAttribute is not honored by the runtime and must not be used.", error: true, DiagnosticId = "MSLIB0002", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+#if NET50_OBSOLETIONS
+        [Obsolete(Obsoletions.PrincipalPermissionAttributeMessage, error: true, DiagnosticId = Obsoletions.PrincipalPermissionAttributeDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
 #endif
         public PrincipalPermissionAttribute(SecurityAction action) : base(default(SecurityAction)) { }
         public bool Authenticated { get; set; }
index 45fc03d..ce5a5aa 100644 (file)
@@ -5,6 +5,9 @@ using System.Security.Cryptography.X509Certificates;
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class PublisherIdentityPermission : CodeAccessPermission
     {
         public PublisherIdentityPermission(X509Certificate certificate) { }
index 66c4420..8347218 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class PublisherIdentityPermissionAttribute : CodeAccessSecurityAttribute
     {
index bd10192..e2bc2ba 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class ReflectionPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public ReflectionPermission(PermissionState state) { }
index b023a7d..e478f8f 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class ReflectionPermissionAttribute : CodeAccessSecurityAttribute
     {
index 4cba9c4..8167e26 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Flags]
     public enum ReflectionPermissionFlag
     {
index 6b0b3a8..5faae9f 100644 (file)
@@ -5,6 +5,9 @@ using System.Security.AccessControl;
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class RegistryPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public RegistryPermission(PermissionState state) { }
index 6b675e6..94d78a1 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Flags]
     public enum RegistryPermissionAccess
     {
index 0d6f101..9665d5e 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class RegistryPermissionAttribute : CodeAccessSecurityAttribute
     {
index 95dd1b1..cab8d9d 100644 (file)
@@ -5,6 +5,9 @@ using System.Collections;
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public abstract class ResourcePermissionBase : CodeAccessPermission, IUnrestrictedPermission
     {
         public const string Any = "*";
index c43dd19..4ad9984 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public class ResourcePermissionBaseEntry
     {
         public ResourcePermissionBaseEntry() { }
index 7365d1d..feb082a 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class SecurityPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public SecurityPermission(PermissionState state) { }
index f73347b..9969587 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class SiteIdentityPermission : CodeAccessPermission
     {
         public SiteIdentityPermission(PermissionState state) { }
index 2c43621..e01e27f 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class SiteIdentityPermissionAttribute : CodeAccessSecurityAttribute
     {
index 773cbde..c99b7d7 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class StorePermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public StorePermission(PermissionState state) { }
index 6fb9a77..29191d8 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed class StorePermissionAttribute : CodeAccessSecurityAttribute
     {
index aeaa045..5d10d3b 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Flags]
     public enum StorePermissionFlags
     {
index d3cb3c4..4c82838 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class StrongNameIdentityPermission : CodeAccessPermission
     {
         public StrongNameIdentityPermission(PermissionState state) { }
index 7482738..d631f89 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class StrongNameIdentityPermissionAttribute : CodeAccessSecurityAttribute
     {
index 78ce731..14f7fc8 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class StrongNamePublicKeyBlob
     {
         public StrongNamePublicKeyBlob(byte[] publicKey) { }
index 94db9d0..8dad856 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class TypeDescriptorPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public TypeDescriptorPermission(PermissionState state) { }
index 35a4a4b..107f99a 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed class TypeDescriptorPermissionAttribute : CodeAccessSecurityAttribute
     {
index 77af900..fb137fd 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [Flags]
     public enum TypeDescriptorPermissionFlags
     {
index a39b5cf..ce45a21 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class UIPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public UIPermission(PermissionState state) { }
index c178e63..bd53734 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class UIPermissionAttribute : CodeAccessSecurityAttribute
     {
index d094e3b..e6d08e6 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public enum UIPermissionClipboard
     {
         AllClipboard = 2,
index 469bc4a..8611c8b 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public enum UIPermissionWindow
     {
         AllWindows = 3,
index 0c9c76e..8b828ab 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class UrlIdentityPermission : CodeAccessPermission
     {
         public UrlIdentityPermission(PermissionState state) { }
index 6190536..a80aca3 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class UrlIdentityPermissionAttribute : CodeAccessSecurityAttribute
     {
index 0361142..1fc5a73 100644 (file)
@@ -2,12 +2,19 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public enum WebBrowserPermissionLevel
     {
         None,
         Safe,
         Unrestricted
     }
+
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class WebBrowserPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public WebBrowserPermission() { }
@@ -23,6 +30,9 @@ namespace System.Security.Permissions
         public WebBrowserPermissionLevel Level { get { return WebBrowserPermissionLevel.Unrestricted; } set { } }
     }
 
+#if NET50_OBSOLETIONS
+    [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)]
     public sealed class WebBrowserPermissionAttribute : CodeAccessSecurityAttribute
     {
index c27ee91..4768866 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class ZoneIdentityPermission : CodeAccessPermission
     {
         public ZoneIdentityPermission(PermissionState state) { }
index b9bf61f..ab60bb0 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     [AttributeUsage((AttributeTargets)(109), AllowMultiple = true, Inherited = false)]
     public sealed partial class ZoneIdentityPermissionAttribute : CodeAccessSecurityAttribute
     {
index bffdd93..834d129 100644 (file)
@@ -9,10 +9,16 @@ namespace System.Security.Policy
     {
         public ApplicationTrust() { }
         public ApplicationTrust(ApplicationIdentity identity) { }
+#if NET50_OBSOLETIONS
+        [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
         public ApplicationTrust(PermissionSet defaultGrantSet, IEnumerable<StrongName> fullTrustAssemblies) { }
         public ApplicationIdentity ApplicationIdentity { get; set; }
         public PolicyStatement DefaultGrantSet { get; set; }
         public object ExtraInfo { get; set; }
+#if NET50_OBSOLETIONS
+        [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
         public IList<StrongName> FullTrustAssemblies { get { return default(IList<StrongName>); } }
         public bool IsApplicationTrustedToRun { get; set; }
         public bool Persist { get; set; }
index 1c5b2c3..085dea2 100644 (file)
@@ -3,6 +3,9 @@
 
 namespace System.Security.Policy
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class FileCodeGroup : CodeGroup
     {
         public FileCodeGroup(IMembershipCondition membershipCondition, Permissions.FileIOPermissionAccess access) : base(default(IMembershipCondition), default(PolicyStatement)) { }
index d2b5b98..69c1c87 100644 (file)
@@ -5,6 +5,9 @@ using System.Security.Permissions;
 
 namespace System.Security.Policy
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class StrongName : EvidenceBase, IIdentityPermissionFactory
     {
         public StrongName(StrongNamePublicKeyBlob blob, string name, Version version) { }
index 7c5289e..31a5a5a 100644 (file)
@@ -5,6 +5,9 @@ using System.Security.Permissions;
 
 namespace System.Security.Policy
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed partial class StrongNameMembershipCondition : ISecurityEncodable, ISecurityPolicyEncodable, IMembershipCondition
     {
         public StrongNameMembershipCondition(StrongNamePublicKeyBlob blob, string name, Version version) { }
index b08cd1c..90377ad 100644 (file)
@@ -6,6 +6,9 @@ using System.Collections;
 
 namespace System.Security
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public static partial class SecurityManager
     {
         [Obsolete]
index 462dbd4..d98493b 100644 (file)
@@ -5,6 +5,9 @@ using System.Security.Permissions;
 
 namespace System.ServiceProcess
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class ServiceControllerPermission : ResourcePermissionBase
     {
         public ServiceControllerPermission() { }
index 2af2f6e..3d797f7 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Transactions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class DistributedTransactionPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public DistributedTransactionPermission(PermissionState state) { }
index 87b203d..e4e7ac7 100644 (file)
@@ -6,6 +6,9 @@ using System.Security.Permissions;
 
 namespace System.Web
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class AspNetHostingPermission :  CodeAccessPermission, IUnrestrictedPermission
     {
         public AspNetHostingPermission(PermissionState state) { }
index c4d74e5..12e7abe 100644 (file)
@@ -9,6 +9,9 @@ using System.Security.Permissions;
 
 namespace System.Xaml.Permissions
 {
+#if NET50_OBSOLETIONS
+    [Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+#endif
     public sealed class XamlLoadPermission : CodeAccessPermission, IUnrestrictedPermission
     {
         public XamlLoadPermission(PermissionState state) { }
index e6c10c1..2097721 100644 (file)
@@ -1,6 +1,8 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
+    <!-- SYSLIB0003 is the obsoletion of CAS, but we still have unit tests for it -->
+    <NoWarn>$(NoWarn);SYSLIB0003</NoWarn>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="ApplicationTrustTests.cs" />
index c7ad112..834158f 100644 (file)
@@ -95,9 +95,9 @@ namespace System.Text
     }
     public partial class UTF7Encoding : System.Text.Encoding
     {
-        [System.ObsoleteAttribute("The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.", DiagnosticId = "MSLIB0001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+        [System.ObsoleteAttribute("The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.", DiagnosticId = "SYSLIB0001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public UTF7Encoding() { }
-        [System.ObsoleteAttribute("The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.", DiagnosticId = "MSLIB0001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+        [System.ObsoleteAttribute("The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.", DiagnosticId = "SYSLIB0001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public UTF7Encoding(bool allowOptionals) { }
         public override bool Equals(object? value) { throw null; }
         [System.CLSCompliantAttribute(false)]
index f4077aa..78c22e0 100644 (file)
@@ -5,7 +5,7 @@
     <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
     <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
     <!-- Encoding.UTF7 and UTF7Encoding are obsolete, but we're the unit test project for it, so suppress warnings -->
-    <NoWarn>$(NoWarn),MSLIB0001</NoWarn>
+    <NoWarn>$(NoWarn),SYSLIB0001</NoWarn>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="ASCIIEncoding\ASCIIEncodingEncode.cs" />
index 142afde..83df550 100644 (file)
@@ -50,7 +50,9 @@ namespace System.Threading
         public string? Name { get { throw null; } set { } }
         public System.Threading.ThreadPriority Priority { get { throw null; } set { } }
         public System.Threading.ThreadState ThreadState { get { throw null; } }
+        [System.ObsoleteAttribute("Thread.Abort is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0006", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public void Abort() { }
+        [System.ObsoleteAttribute("Thread.Abort is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0006", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
         public void Abort(object? stateInfo) { }
         public static System.LocalDataStoreSlot AllocateDataSlot() { throw null; }
         public static System.LocalDataStoreSlot AllocateNamedDataSlot(string name) { throw null; }
index 55a53c8..443c500 100644 (file)
@@ -731,12 +731,12 @@ namespace System.Threading.Threads.Tests
 
             Action verify = () =>
             {
+#pragma warning disable SYSLIB0006, 618 // Obsolete: Abort, Suspend, Resume
                 Assert.Throws<PlatformNotSupportedException>(() => t.Abort());
                 Assert.Throws<PlatformNotSupportedException>(() => t.Abort(t));
-#pragma warning disable 618 // Obsolete members
                 Assert.Throws<PlatformNotSupportedException>(() => t.Suspend());
                 Assert.Throws<PlatformNotSupportedException>(() => t.Resume());
-#pragma warning restore 618 // Obsolete members
+#pragma warning restore SYSLIB0006, 618 // Obsolete: Abort, Suspend, Resume
             };
             verify();
 
index 3ae5512..feedd6a 100644 (file)
@@ -551,6 +551,7 @@ namespace System.Reflection.Emit
             }
         }
 
+        [Obsolete(Obsoletions.GlobalAssemblyCacheMessage, DiagnosticId = Obsoletions.GlobalAssemblyCacheDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public override bool GlobalAssemblyCache
         {
             get
index 50814ab..e1f386a 100644 (file)
@@ -107,6 +107,7 @@ namespace System.Reflection
 
         public override Module ManifestModule => GetManifestModuleInternal();
 
+        [Obsolete(Obsoletions.GlobalAssemblyCacheMessage, DiagnosticId = Obsoletions.GlobalAssemblyCacheDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
         public override bool GlobalAssemblyCache => false;
 
         public override long HostContext => 0;