APIs that always throw exceptions on .NET Core and .NET 5+
مقالة 11/22/2024
6 من المساهمين
الملاحظات
في هذه المقالة
The following APIs will always throw an exception on .NET (Core) on all or a subset of platforms. In most cases, the exception that's thrown is PlatformNotSupportedException .
This article organizes the affected APIs by namespace.
Note
This article is a work-in-progress. It is not a complete list of APIs that throw exceptions on .NET 5+.
This article does not include the explicit interface implementations for binary serialization that throw on .NET 5+. For more information, see Binary serialization in .NET Core .
System
System.CodeDom.Compiler
System.Collections.Specialized
System.Configuration
System.Console
System.Data.Common
System.Diagnostics.Process
System.IO
System.IO.Pipes
System.Net
Member
Platforms that throw
System.Net.AuthenticationManager *
All
AuthenticationManager.Authenticate(String, WebRequest, ICredentials)
All
AuthenticationManager.PreAuthenticate(WebRequest, ICredentials)
All
FileWebRequest(SerializationInfo, StreamingContext)
All
FileWebRequest.GetObjectData(SerializationInfo, StreamingContext)
All
FileWebResponse(SerializationInfo, StreamingContext)
All
FileWebResponse.GetObjectData(SerializationInfo, StreamingContext)
All
HttpWebRequest(SerializationInfo, StreamingContext)
All
HttpWebRequest.GetObjectData(SerializationInfo, StreamingContext)
All
HttpWebResponse(SerializationInfo, StreamingContext)
All
HttpWebResponse.GetObjectData(SerializationInfo, StreamingContext)
All
WebProxy(SerializationInfo, StreamingContext)
All
WebProxy.GetDefaultProxy()
All
WebProxy.GetObjectData
All
WebRequest(SerializationInfo, StreamingContext)
All
WebRequest.GetObjectData(SerializationInfo, StreamingContext)
All
WebResponse(SerializationInfo, StreamingContext)
All
WebResponse.GetObjectData(SerializationInfo, StreamingContext)
All
* .NET 9 and later versions.
Member
Platforms that throw
Ping.Send
Windows (UWP)
System.Net.Sockets
System.Net.WebSockets
System.Reflection
System.Runtime.CompilerServices
System.Runtime.InteropServices
System.Runtime.Serialization
* .NET 9 and later versions.
† .NET 8 only for all project types except Windows Forms and WPF.
System.Security
System.Security.Claims
System.Security.Cryptography
System.Security.Cryptography.Pkcs
System.Security.Cryptography.X509Certificates
System.Security.Authentication.ExtendedProtection
System.Security.Policy
System.ServiceProcess.ServiceController
System.Text.RegularExpressions
System.Threading
System.Xml
Member
Platforms that throw
XmlDictionaryReader.CreateMtomReader(Byte[], Int32, Int32, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose)
All
XmlDictionaryReader.CreateMtomReader(Stream, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose)
All
XmlDictionaryWriter.CreateMtomWriter(Stream, Encoding, Int32, String, String, String, Boolean, Boolean)
All
See also