API obsoletions with default diagnostic ID (.NET 7)
Several APIs have been marked as obsolete in .NET 7. Referencing these APIs in your code will result in build warnings. In C#, the compiler diagnostic for these obsoletions is CS0618.
Previous behavior
Previously, the affected APIs could be referenced without any build warnings.
New behavior
Starting in .NET 7, referencing the affected APIs will result in build warnings.
Version introduced
.NET 7 Preview 3
Type of breaking change
These obsoletions can affect source compatibility.
Reason for change
These APIs were previously marked obsolete in the implementation assemblies but not in the reference assemblies. The reference assemblies have now been updated to match the implementation assemblies.
Recommended action
Follow the recommended action that's emitted when you use the obsolete API.
Affected APIs
- System.ComponentModel.IComNativeDescriptorHandler
- System.ComponentModel.MemberDescriptor.GetInvokee(Type, Object)
- System.ComponentModel.RecommendedAsConfigurableAttribute
- System.Data.OleDb.OleDbParameterCollection.Add(String, Object)
- System.Net.FileWebRequest.GetObjectData(SerializationInfo, StreamingContext)
- System.Net.FileWebRequest.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo, StreamingContext)
- System.Net.FileWebResponse.GetObjectData(SerializationInfo, StreamingContext)
- System.Net.FileWebResponse.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo, StreamingContext)
- System.Net.Http.HttpRequestMessage.Properties
- System.Net.WebRequest.GetObjectData(SerializationInfo, StreamingContext)
- System.Net.WebRequest.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo, StreamingContext)
- WebResponse(SerializationInfo, StreamingContext) constructor
- System.Net.WebResponse.GetObjectData(SerializationInfo, StreamingContext)
- System.Net.WebResponse.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo, StreamingContext)
- System.Security.Cryptography.PasswordDeriveBytes.GetBytes(Int32)
- System.Web.HttpUtility.UrlEncodeUnicode(String)
- System.Web.HttpUtility.UrlEncodeUnicodeToBytes(String)