-
Notifications
You must be signed in to change notification settings - Fork 162
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
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8f29df6
Add spec for obsoletions in .NET 5
jeffhandley 9f91469
remove IsApplicationTargeting45; fix typo and spacing
jeffhandley 5341a6c
Move PrepareContractedDelegate; obsolete PrincipalPermission/Permissi…
jeffhandley 1afcf7c
Add classes that derive from CodeAccessSecurityAttribute
jeffhandley 57bc5bd
Add IPermission and its implementers and their derivatives
jeffhandley 5c6b284
Add IStackWalk and its implementers
jeffhandley 2d5ffd8
Add SecurityAction.PermitOnly to the obsoletions
jeffhandley 9d24eca
Combine PrincipalPermission into the CAS category; dedupe some APIs
jeffhandley 2b4bc33
Use SYSLIB for the diagnostic id prefix
jeffhandley 93cede3
Add an Other Considerations section
jeffhandley c89b679
Update messages; dedupe some Permissions APIs; fix a typo
jeffhandley c13825b
Update spec to capture APIs gathered during implementation
jeffhandley 107d6ef
Split the PrincipalPermissionAttribute constructor diagnostic out to …
jeffhandley 8721db6
Encoding.UTF7 was obsoleted too
jeffhandley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,234 @@ | ||
# 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: `SYSLIB0004` | ||
* 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.PrepareContractedDelegate` | ||
* `System.Runtime.CompilerServices.RuntimeHelpers.ProbeForSufficientStack` | ||
1. The Global Assembly Cache is no longer implemented | ||
* DiagnosticId: `SYSLIB0005` | ||
* APIs: | ||
* `System.Reflection.Assembly.GlobalAssemblyCache` | ||
1. `Thread.Abort` is no longer supported and throws PlatformNotSupportedException | ||
* DiagnosticId: `SYSLIB0006` | ||
* 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: `SYSLIB0007` | ||
* APIs: | ||
* `System.Security.Cryptography.SymmetricAlgorithm.Create()` | ||
* `System.Security.Cryptography.AssymetricAlgorithm.Create()` | ||
* `System.Security.Cryptography.HMAC.Create()` | ||
* `System.Security.Cryptography.KeyedHashAlgorithm.Create()` | ||
1. The CreatePdbGenerator API is no longer supported and throws PlatformNotSupportedException | ||
* DiagnosticId: `SYSLIB0008` | ||
* APIs: | ||
* `System.Runtime.CompilerServices.DebugInfoGenerator.CreatePdbGenerator` | ||
1. The AuthenticationManager Authenticate and PreAuthenticate APIs are no longer supported and throw PlatformNotSupportedException | ||
* DiagnosticId: `SYSLIB0009` | ||
* APIs: | ||
* `System.Net.AuthenticationManager.Authenticate` | ||
* `System.Net.AuthenticationManager.PreAuthenticate` | ||
1. These Remoting APIs are no longer supported and throw PlatformNotSupportedException | ||
* DiagnosticId: `SYSLIB0010` | ||
* APIs: | ||
* `System.MarshalByRefObject.GetLifetimeService` | ||
* `System.MarshalByRefObject.InitializeLifetimeService` | ||
1. Code Access Security (CAS) APIs are no longer supported | ||
* DiagnosticId: `SYSLIB0002` (reusing the existing DiagnosticId from `PrincipalPermissionAttribute`) | ||
* APIs: | ||
* Classes: (everything from the `System.Security.Permissions` namespace) | ||
* `CodeAccessSecurityAttribute` | ||
* `DataProtectionPermission` | ||
* `DataProtectionPermissionAttribute` | ||
* `EnvironmentPermission` | ||
* `EnvironmentPermissionAttribute` | ||
* `FileDialogPermission` | ||
* `FileDialogPermissionAttribute` | ||
* `FileIOPermission` | ||
* `FileIOPermissionAttribute` | ||
* `GacIdentityPermission` | ||
* `GacIdentityPermissionAttribute` | ||
* `HostProtectionAttribute` | ||
* `IsolatedStorageFilePermission` | ||
* `IsolatedStorageFilePermissionAttribute` | ||
* `IsolatedStoragePermission` | ||
* `IsolatedStoragePermissionAttribute` | ||
* `KeyContainerPermission` | ||
* `KeyContainerPermissionAttribute` | ||
* `KeyContainerPermissionAccessEntry` | ||
* `KeyContainerPermissionAccessEntryCollection` | ||
* `MediaPermission` | ||
* `MediaPermissionAttribute` | ||
* `PermissionSetAttribute` | ||
* `PrincipalPermission` | ||
* `PrincipalPermissionAttribute` (already has the attribute) | ||
* `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` | ||
* Classes that derive from `CodeAccessSecurityAttribute` | ||
* `System.Configuration.ConfigurationPermissionAttribute` | ||
* `System.Data.Common.DBDataPermissionAttribute` | ||
* `System.Data.OracleClient.OraclePermissionAttribute` | ||
* `System.Diagnostics.EventLogPermissionAttribute` | ||
* `System.Diagnostics.PerformanceCounterPermissionAttribute` | ||
* `System.DirectoryServices.DirectoryServicesPermissionAttribute` | ||
* `System.Drawing.Printing.PrintingPermissionAttribute` | ||
* `System.IdentityModel.Services.ClaimsPrincipalPermissionAttribute` | ||
* `System.Messaging.MessageQueuePermissionAttribute` | ||
* `System.Net.DnsPermissionAttribute` | ||
* `System.Net.SocketPermissionAttribute` | ||
* `System.Net.WebPermissionAttribute` | ||
* `System.Net.Mail.SmtpPermissionAttribute` | ||
* `System.Net.NetworkInformation.NetworkInformationPermissionAttribute` | ||
* `System.Net.PeerToPeer.PnrpPermissionAttribute` | ||
* `System.Net.PeerToPeer.Collaboration.PeerCollaborationPermissionAttribute` | ||
* `System.Security.Permissions.DataProtectionPermissionAttribute` | ||
* `System.Security.Permissions.EnvironmentPermissionAttribute` | ||
* `System.Security.Permissions.FileDialogPermissionAttribute` | ||
* `System.Security.Permissions.FileIOPermissionAttribute` | ||
* `System.Security.Permissions.GacIdentityPermissionAttribute` | ||
* `System.Security.Permissions.HostProtectionAttribute` | ||
* `System.Security.Permissions.IsolatedStoragePermissionAttribute` | ||
* `System.Security.Permissions.KeyContainerPermissionAttribute` | ||
* `System.Security.Permissions.MediaPermissionAttribute` | ||
* `System.Security.Permissions.PermissionSetAttribute` | ||
* `System.Security.Permissions.PrincipalPermissionAttribute` | ||
* `System.Security.Permissions.PublisherIdentityPermissionAttribute` | ||
* `System.Security.Permissions.ReflectionPermissionAttribute` | ||
* `System.Security.Permissions.RegistryPermissionAttribute` | ||
* `System.Security.Permissions.SecurityPermissionAttribute` | ||
* `System.Security.Permissions.SiteIdentityPermissionAttribute` | ||
* `System.Security.Permissions.StorePermissionAttribute` | ||
* `System.Security.Permissions.StrongNameIdentityPermissionAttribute` | ||
* `System.Security.Permissions.TypeDescriptorPermissionAttribute` | ||
* `System.Security.Permissions.UIPermissionAttribute` | ||
* `System.Security.Permissions.UrlIdentityPermissionAttribute` | ||
* `System.Security.Permissions.WebBrowserPermissionAttribute` | ||
* `System.Security.Permissions.ZoneIdentityPermissionAttribute` | ||
* `System.ServiceProcess.ServiceControllerPermissionAttribute` | ||
* `System.Transactions.DistributedTransactionPermissionAttribute` | ||
* `System.Web.AspNetHostingPermissionAttribute` | ||
* Interfaces: | ||
* `System.Security.PermissionsIUnrestrictedPermission` | ||
* `System.Security.IPermission` | ||
* `System.Security.IStackWalk` | ||
* Classes that implement `IStackWalk` | ||
* `System.Security.PermissionSet` | ||
* `System.Security.NamedPermissionSet` | ||
* `System.Security.ReadOnlyPermissionSet` | ||
* Classes that implement `IPermission` | ||
* `System.IdentityModel.Services.ClaimsPrincipalPermission` | ||
* `System.Security.CodeAccessPermission` | ||
* Classes that derive from `CodeAccessPermission` (also includes implementations of `PermissionsIUnrestrictedPermission`) | ||
* `System.Configuration.ConfigurationPermission` | ||
* `System.Data.Common.DBDataPermission` | ||
* `System.Data.Odbc.OdbcPermission` | ||
* `System.Data.OleDb.OleDbPermission` | ||
* `System.Data.SqlClient.SqlClientPermission` | ||
* `System.Data.OracleClient.OraclePermission` | ||
* `System.Drawing.Printing.PrintingPermission` | ||
* `System.Messaging.MessageQueuePermission` | ||
* `System.Net.DnsPermission` | ||
* `System.Net.SocketPermission` | ||
* `System.Net.WebPermission` | ||
* `System.Net.Mail.SmtpPermission` | ||
* `System.Net.NetworkInformation.NetworkInformationPermission` | ||
* `System.Net.PeerToPeer.PnrpPermission` | ||
* `System.Net.PeerToPeer.Collaboration.PeerCollaborationPermission` | ||
* `System.Transactions.DistributedTransactionPermission` | ||
* `System.Web.AspNetHostingPermission` | ||
* `System.Xaml.Permissions.XamlLoadPermission` | ||
* Classes that derive from `ResourcePermissionBase` | ||
* `System.Diagnostics.EventLogPermission` | ||
* `System.Diagnostics.PerformanceCounterPermission` | ||
* `System.DirectoryServices.DirectoryServicesPermission` | ||
* `System.ServiceProcess.ServiceControllerPermission` | ||
* Enums: (everything from the `System.Security.Permissions` namespace) | ||
* `DataProtectionPermissionFlags` | ||
* `EnvironmentPermissionAccess` | ||
* `FileDialogPermissionAccess` | ||
* `FileIOPermissionAccess` | ||
* `HostProtectionResource` | ||
* `IsolatedStorageContainment` | ||
* `KeyContainerPermissionFlags` | ||
* `MediaPermissionAudio` | ||
* `MediaPermissionImage` | ||
* `MediaPermissionVideo` | ||
* `PermissionState` | ||
* `ReflectionPermissionFlag` | ||
* `RegistryPermissionAccess` | ||
* `SecurityAction` (with removal of the existing attributes on members) | ||
* `SecurityPermissionFlag` | ||
* `StorePermissionFlags` | ||
* `TypeDescriptorPermissionFlags` | ||
* `UIPermissionClipboard` | ||
* `UIPermissionWindow` | ||
* `WebBrowserPermissionLevel` | ||
|
||
## Other Considerations | ||
|
||
Several other APIs were considered for obsoletion in .NET 5, but we chose to focus | ||
on groupings of APIs that categorically do not work in .NET 5. This strategy optimizes | ||
for projects migrating from .NET Framework while keeping the risk of negative disruption | ||
relatively low. | ||
|
||
Some specific APIs had already been suggested for obsoletion. We reviewed those suggestions | ||
during this consideration as well. For example, [`SecureString`](https://github.com/dotnet/runtime/issues/30612) | ||
was considered but we chose to omit it for now. We are aware of some notable usage of | ||
`SecureString` where marking it as obsolete would cause disruption, and we do not yet | ||
have a clear alternative approach to recommend. | ||
|
||
Obsoleting the set of APIs above will still provide enough usage of the new obsoletion | ||
behavior that we can collect feedback from users and determine how aggressively we can | ||
obsolete more APIs in .NET 6. | ||
|
||
We would also like to thank @Joe4evr for helping kickstart the conversation with | ||
[#33360](https://github.com/dotnet/runtime/issues/33360). That issue will remain open | ||
and we will continue consider the APIs noted there in future releases. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.