Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spec for obsoletions in .NET 5 #139

Merged
merged 14 commits into from
Jul 15, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions accepted/2020/better-obsoletion/obsoletions-in-net5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# Obsoletions in .NET 5

**PM** [Immo Landwerth](https://github.com/terrajobst)

For .NET 5, [we're making](better-obsoletion.md) it more viable to obsolete APIs.
In this document, we're describing which APIs we intend to obsolete in .NET 5 and
which diagnostic IDs we will use for those.

With `dotnet/runtime` PR [#33248](https://github.com/dotnet/runtime/pull/33248),
the `ObsoleteAttribute` gained new `DiagnosticId` and `UrlFormat` properties. With
these properties, obsoletions can be grouped together when multiple APIs are
marked as obsolete for the same reason. This capability is reflected in the list
of obsoletions below. All of these obsoletions will use the `UrlFormat` of
`https://aka.ms/dotnet-warnings/{0}`.

1. The Constrained Execution Region (CER) feature is no longer implemented
* DiagnosticId: `MSLIB0004`
jeffhandley marked this conversation as resolved.
Show resolved Hide resolved
jeffhandley marked this conversation as resolved.
Show resolved Hide resolved
* APIs:
* `System.Runtime.ConstrainedExecution.PrePrepareMethodAttribute`
* `System.Runtime.ConstrainedExecution.ReliabilityContractAttribute`
* `System.Runtime.ConstrainedExecution.Cer`
* `System.Runtime.ConstrainedExecution.Consistency`
* `System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup`
* `System.Runtime.CompilerServices.RuntimeHelpers.PrepareConstrainedRegions`
* `System.Runtime.CompilerServices.RuntimeHelpers.PrepareConstrainedRegionsNoOP`
* `System.Runtime.CompilerServices.RuntimeHelpers.ProbeForSufficientStack`
1. This AppDomain method is no longer implemented
* DiagnosticId: `MSLIB0005`
jeffhandley marked this conversation as resolved.
Show resolved Hide resolved
* APIs:
* `PrepareContractedDelegate`
jeffhandley marked this conversation as resolved.
Show resolved Hide resolved
1. The Global Assembly Cache is no longer implemented
* DiagnosticId: `MSLIB0006`
* APIs:
* `System.Reflection.Assembly.GlobalAssemblyCache`
1. `Thread.Abort` is no longer supported and throws PlatformNotSupportedException
* DiagnosticId: `MSLIB0007`
* APIs:
* `System.Threading.Thread.Abort()`
* `System.Threading.Thread.Abort(Object)`
1. The default implementations of these cryptography algorithms are no longer supported and throw PlatformNotSupportedException
* DiagnosticId: `MSLIB0008`
* APIs:
* `System.Security.Cryptography.SymmetricAlgorithm.Create()`
* `System.Security.Cryptography.AssymetricAlgorithm.Create()`
* `System.Security.Cryptography.HMAC.Create()`
* `System.Security.Cryptography.KeyedHashAlgorithm.Create()`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bartonjs HashAlgorithm.Create() also throws (and there's a unit test including it in the same list as these others). Should we obsolete it as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HashAlgorithm.Create() also throws (and there's a unit test including it in the same list as these others). Should we obsolete it as well?

Yep.

1. The CreatePdbGenerator API is no longer supported and throws PlatformNotSupportedException
* DiagnosticId: `MSLIB0009`
* APIs:
* `System.Runtime.CompilerServices.DebugInfoGenerator.CreatePdbGenerator`
1. The AuthenticationManager Authenticate and PreAuthenticate APIs are no longer supported and throw PlatformNotSupportedException
* DiagnosticId: `MSLIB0010`
* APIs:
* `System.Net.AuthenticationManager.Authenticate`
* `System.Net.AuthenticationManager.PreAuthenticate`
1. These Remoting APIs are no longer supported and throw PlatformNotSupportedException
* DiagnosticId: `MSLIB0011`
* APIs:
* `System.MarshalByRefObject.GetLifetimeService`
* `System.MarshalByRefObject.InitializeLifetimeService`
1. Code Access Security (CAS) APIs are no longer supported
* DiagnosticId: `MSLIB0012`
* APIs: (all from the `System.Security.Permissions` namespace)
* Classes: (everything *except* `PrincipalPermission` (still implemented) and `PrincipalPermissionAttribute` (already obsolete))
jeffhandley marked this conversation as resolved.
Show resolved Hide resolved
* `CodeAccessSecurityAttribute`
* `DataProtectionPermission`
* `DataProtectionPermissionAttribute`
* `EnvironmentPermission`
* `EnvironmentPermissionAttribute`
* `FileDialogPermission`
* `FileDialogPermissionAttribute`
* `FileIOPermission`
* `FileIOPermissionAttribute`
* `GacIdentityPermission`
* `GacIdentityPermissionAttribute`
* `HostProtectionAttribute`
* `IsolatedStorageFilePermission`
* `IsolatedStorageFilePermissionAttribute`
* `IsolatedStoragePermission`
* `IsolatedStoragePermissionAttribute`
* `KeyContainerPermission`
* `KeyContainerPermissionAttribute`
* `KeyContainerPermissionAccessEntry`
* `KeyContainerPermissionAccessEntryCollection`
* `MediaPermission`
* `MediaPermissionAttribute`
* `PermissionSetAttribute`
* `PublisherIdentityPermission`
* `PublisherIdentityPermissionAttribute`
* `ReflectionPermission`
* `ReflectionPermissionAttribute`
* `RegistryPermission`
* `RegistryPermissionAttribute`
* `ResourcePermissionBase`
* `ResourcePermissionBaseEntry`
* `SecurityAttribute`
* `SecurityPermission`
* `SecurityPermissionAttribute`
* `SiteIdentityPermission`
* `SiteIdentityPermissionAttribute`
* `StorePermission`
* `StorePermissionAttribute`
* `StrongNameIdentityPermission`
* `StrongNameIdentityPermissionAttribute`
* `StrongNamePublicKeyBlob`
* `TypeDescriptorPermission`
* `TypeDescriptorPermissionAttribute`
* `UIPermission`
* `UIPermissionAttribute`
* `UrlIdentityPermission`
* `UrlIdentityPermissionAttribute`
* `WebBrowserPermission`
* `WebBrowserPermissionAttribute`
* `ZoneIdentityPermission`
* `ZoneIdentityPermissionAttribute`
* Interfaces:
* `IUnrestrictedPermission`
* Enums: (everything *except* `PermissionState`, which is used by `PrincipalPermission`)
* `DataProtectionPermissionFlags`
* `EnvironmentPermissionAccess`
* `FileDialogPermissionAccess`
* `FileIOPermissionAccess`
* `HostProtectionResource`
* `IsolatedStorageContainment`
* `KeyContainerPermissionFlags`
* `MediaPermissionAudio`
* `MediaPermissionImage`
* `MediaPermissionVideo`
* `ReflectionPermissionFlag`
* `RegistryPermissionAccess`
* `SecurityAction`
* `SecurityPermissionFlag`
* `StorePermissionFlags`
* `TypeDescriptorPermissionFlags`
* `UIPermissionClipboard`
* `UIPermissionWindow`
* `WebBrowserPermissionLevel`