Comparteix via


APIs que siempre arrojan excepciones en .NET (Core)

Las siguientes APIs siempre generan una excepción en las .NET (Core) en todas o en un subconjunto de plataformas. En la mayoría de los casos, la excepción que se produce es PlatformNotSupportedException.

En este artículo se organizan las API afectadas por espacio de nombres.

Nota:

  • Este artículo es un trabajo en curso. No es una lista completa de las API que generan excepciones en .NET 5 y superiores.
  • En este artículo no se incluyen las implementaciones de interfaz explícitas para la serialización binaria que inician excepciones en .NET 5+. Para obtener más información, consulte Serialización binaria en .NET Core.

Sistema

Miembro Plataformas en las que se produce
AppDomain.CreateDomain Todos
AppDomain.ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm) Todos
AppDomain.Unload(AppDomain) Todos
Console.CapsLock Linux y macOS
Console.NumberLock Linux y macOS
Delegate.GetObjectData(SerializationInfo, StreamingContext) Todos
Exception.SerializeObjectState Todos
MarshalByRefObject.GetLifetimeService() Todos
MarshalByRefObject.InitializeLifetimeService() Todos
OperatingSystem.GetObjectData(SerializationInfo, StreamingContext) Todos
Type.ReflectionOnlyGetType(String, Boolean, Boolean) Todos

System.CodeDom.Compiler

Miembro Plataformas en las que se produce
CodeDomProvider.CompileAssemblyFromDom Todos
CodeDomProvider.CompileAssemblyFromFile Todos
CodeDomProvider.CompileAssemblyFromSource Todos

System.Collections.Specialized

Miembro Plataformas en las que se produce
NameObjectCollectionBase(SerializationInfo, StreamingContext) Todos
NameObjectCollectionBase.GetObjectData(SerializationInfo, StreamingContext) Todos
NameObjectCollectionBase.OnDeserialization(Object) Todos

System.Configuration

Miembro Plataformas en las que se produce
System.Configuration.RsaProtectedConfigurationProvider (todos los miembros) Todos

System.Console

Miembro Plataformas en las que se produce
Console.Beep() Linux y macOS
Console.BufferHeight (solo Establecer) Linux y macOS
Console.BufferWidth (solo Establecer) Linux y macOS
Console.CursorSize (solo Establecer) Linux y macOS
Console.CursorVisible (solo Obtener) Linux y macOS
Console.MoveBufferArea Linux y macOS
Console.SetWindowPosition Linux y macOS
Console.SetWindowSize Linux y macOS
Console.Title (solo Obtener) Linux y macOS
Console.WindowHeight (solo Establecer) Linux y macOS
Console.WindowLeft (solo Establecer) Linux y macOS
Console.WindowTop (solo Establecer) Linux y macOS
Console.WindowWidth (solo Establecer) Linux y macOS

System.Data.Common

Miembro Plataformas en las que se produce
DbDataReader.GetSchemaTable (genera NotSupportedException) Todos

System.Diagnostics.Process

Miembro Plataformas en las que se produce
Process.MaxWorkingSet (solo Establecer) Linux
Process.MinWorkingSet (solo Establecer) Linux
Process.ProcessorAffinity macOS
Process.MainWindowHandle Linux y macOS
Process.Start(String, String, String, SecureString, String) Linux y macOS
Process.Start(String, String, SecureString, String) Linux y macOS
ProcessStartInfo.UserName Linux y macOS
ProcessStartInfo.PasswordInClearText Linux y macOS
ProcessStartInfo.Domain Linux y macOS
ProcessStartInfo.LoadUserProfile Linux y macOS
ProcessThread.BasePriority (solo Establecer) Linux y macOS
ProcessThread.BasePriority (solo Obtener) macOS
ProcessThread.ProcessorAffinity (solo Establecer) Linux y macOS

System.IO

Miembro Plataformas en las que se produce
FileSystemInfo(SerializationInfo, StreamingContext) Todos
FileSystemInfo.GetObjectData(SerializationInfo, StreamingContext) Todos

System.IO.Pipes

Miembro Plataformas en las que se produce
NamedPipeClientStream.NumberOfServerInstances Linux y macOS
NamedPipeServerStream.GetImpersonationUserName() Linux y macOS
PipeStream.InBufferSize Linux y macOS
PipeStream.OutBufferSize Linux y macOS
PipeStream.ReadMode (solo Establecer) Linux y macOS
PipeStream.WaitForPipeDrain() Linux y macOS

System.Media

Miembro Plataformas en las que se produce
SoundPlayer(SerializationInfo, StreamingContext) Todos

System.Net

Miembro Plataformas en las que se produce
System.Net.AuthenticationManager* Todos
AuthenticationManager.Authenticate(String, WebRequest, ICredentials) Todos
AuthenticationManager.PreAuthenticate(WebRequest, ICredentials) Todos
FileWebRequest(SerializationInfo, StreamingContext) Todos
FileWebRequest.GetObjectData(SerializationInfo, StreamingContext) Todos
FileWebResponse(SerializationInfo, StreamingContext) Todos
FileWebResponse.GetObjectData(SerializationInfo, StreamingContext) Todos
HttpWebRequest(SerializationInfo, StreamingContext) Todos
HttpWebRequest.GetObjectData(SerializationInfo, StreamingContext) Todos
HttpWebResponse(SerializationInfo, StreamingContext) Todos
HttpWebResponse.GetObjectData(SerializationInfo, StreamingContext) Todos
WebProxy(SerializationInfo, StreamingContext) Todos
WebProxy.GetDefaultProxy() Todos
WebProxy.GetObjectData Todos
WebRequest(SerializationInfo, StreamingContext) Todos
WebRequest.GetObjectData(SerializationInfo, StreamingContext) Todos
WebResponse(SerializationInfo, StreamingContext) Todos
WebResponse.GetObjectData(SerializationInfo, StreamingContext) Todos

* .NET 9 y versiones posteriores.

System.Net.NetworkInformation

Miembro Plataformas en las que se produce
Ping.Send Windows (UWP)

System.Net.Sockets

Miembro Plataformas en las que se produce
Socket(SocketInformation) Todos
Socket.DuplicateAndClose(Int32) Todos

System.Net.WebSockets

Miembro Plataformas en las que se produce
WebSocket.RegisterPrefixes() Todos

System.Reflection

Miembro Plataformas en las que se produce
Assembly.CodeBase Todos
Assembly.EscapedCodeBase Todos
Assembly.LoadFrom(String, Byte[], AssemblyHashAlgorithm) Todos
Assembly.ReflectionOnlyLoad Todos
Assembly.ReflectionOnlyLoadFrom(String) Todos
AssemblyName.GetObjectData(SerializationInfo, StreamingContext) Todos
AssemblyName.KeyPair Todos
AssemblyName.OnDeserialization(Object) Todos
StrongNameKeyPair Todos
StrongNameKeyPair.PublicKey Todos

System.Runtime.CompilerServices

Miembro Plataformas en las que se produce
DebugInfoGenerator.CreatePdbGenerator() Todos

System.Runtime.InteropServices

Miembro Plataformas en las que se produce
IDispatchImplAttribute Todos
Marshal.GetIDispatchForObject(Object) Todos
RuntimeEnvironment.SystemConfigurationFile Todos
RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid, Guid) Todos
RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid, Guid) Todos
WindowsRuntimeMarshal.StringToHString(String) Linux y macOS
WindowsRuntimeMarshal.PtrToStringHString(IntPtr) Linux y macOS
WindowsRuntimeMarshal.FreeHString(IntPtr) Linux y macOS

System.Runtime.Serialization

Miembro Plataformas en las que se produce
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream, Object)* Todos
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream, Object) Todos
BinaryFormatter.Deserialize(Stream) Todos
XsdDataContractExporter.Schemas Todos

* .NET 9 y versiones posteriores. † .NET 8 solo para todos los tipos de proyecto, excepto Windows Forms y WPF.

System.Security

Miembro Plataformas en las que se produce
CodeAccessPermission.Deny() Todos
CodeAccessPermission.PermitOnly() Todos
PermissionSet.ConvertPermissionSet(String, Byte[], String) Todos
PermissionSet.Deny() Todos
PermissionSet.PermitOnly() Todos
SecurityContext.Capture() Todos
SecurityContext.CreateCopy() Todos
SecurityContext.Dispose() Todos
SecurityContext.IsFlowSuppressed() Todos
SecurityContext.IsWindowsIdentityFlowSuppressed() Todos
SecurityContext.RestoreFlow() Todos
SecurityContext.Run(SecurityContext, ContextCallback, Object) Todos
SecurityContext.SuppressFlow() Todos
SecurityContext.SuppressFlowWindowsIdentity() Todos

System.Security.Claims

Miembro Plataformas en las que se produce
ClaimsPrincipal(SerializationInfo, StreamingContext) Todos
ClaimsPrincipal.GetObjectData(SerializationInfo, StreamingContext) Todos
ClaimsIdentity(SerializationInfo) Todos
ClaimsIdentity(SerializationInfo, StreamingContext) Todos
ClaimsIdentity.GetObjectData(SerializationInfo, StreamingContext) Todos

System.Security.Cryptography

Miembro Plataformas en las que se produce
AesCcm macOS
AsymmetricAlgorithm.Create(String) Todos
System.Security.Cryptography.CngAlgorithm Linux y macOS
System.Security.Cryptography.CngAlgorithmGroup Linux y macOS
System.Security.Cryptography.CngKey Linux y macOS
System.Security.Cryptography.CngKeyBlobFormat Linux y macOS
System.Security.Cryptography.CngKeyCreationParameters Linux y macOS
System.Security.Cryptography.CngProvider Linux y macOS
System.Security.Cryptography.CngUIPolicy Linux y macOS
CryptoConfig.EncodeOID(String) Todos
CspKeyContainerInfo Linux y macOS
CspKeyContainerInfo.Accessible Linux y macOS
CspKeyContainerInfo.Exportable Linux y macOS
CspKeyContainerInfo.HardwareDevice Linux y macOS
CspKeyContainerInfo.KeyContainerName Linux y macOS
CspKeyContainerInfo.KeyNumber Linux y macOS
CspKeyContainerInfo.MachineKeyStore Linux y macOS
CspKeyContainerInfo.Protected Linux y macOS
CspKeyContainerInfo.ProviderName Linux y macOS
CspKeyContainerInfo.ProviderType Linux y macOS
CspKeyContainerInfo.RandomlyGenerated Linux y macOS
CspKeyContainerInfo.Removable Linux y macOS
CspKeyContainerInfo.UniqueKeyContainerName Linux y macOS
DSA.Create* macOS
DSACryptoServiceProvider* macOS
DSACertificateExtensions.GetDSAPrivateKey(X509Certificate2)* macOS
DSACertificateExtensions.GetDSAPublicKey(X509Certificate2)* macOS
DSACertificateExtensions.CopyWithPrivateKey(X509Certificate2, DSA)* macOS
DSAOpenSsl macOS
ECDiffieHellmanCng.FromXmlString(String, ECKeyXmlFormat) Todos
ECDiffieHellmanCng.ToXmlString(ECKeyXmlFormat) Todos
ECDiffieHellmanCngPublicKey.FromXmlString(String) Todos
ECDiffieHellmanCngPublicKey.ToXmlString() Todos
ECDiffieHellmanOpenSsl macOS
ECDiffieHellmanPublicKey.ToByteArray() Linux y macOS
ECDiffieHellmanPublicKey.ToXmlString() Todos
ECDsaCng.FromXmlString(String, ECKeyXmlFormat) Todos
ECDsaCng.ToXmlString(ECKeyXmlFormat) Todos
ECDsaOpenSsl macOS
HashAlgorithm.Create() Todos
HMAC.Create() Todos
HMAC.Create(String) Todos
HMAC.HashCore Todos
HMAC.HashFinal Todos
HMAC.Initialize Todos
KeyedHashAlgorithm.Create() Todos
KeyedHashAlgorithm.Create(String) Todos
ProtectedData.Protect Linux y macOS
ProtectedData.Unprotect Linux y macOS
System.Security.Cryptography.RSACryptoServiceProvider.DecryptValue(Byte[]) Todos
System.Security.Cryptography.RSACryptoServiceProvider.EncryptValue(Byte[]) Todos
RSAOpenSsl macOS
System.Security.Cryptography.RSA.DecryptValue(Byte[]) Todos
System.Security.Cryptography.RSA.EncryptValue(Byte[]) Todos
RSA.FromXmlString Todos
RSA.ToXmlString Todos
System.Security.Cryptography.SafeEvpPKeyHandle macOS
SymmetricAlgorithm.Create() Todos
SymmetricAlgorithm.Create(String) Todos

* .NET 11 y versiones posteriores.

System.Security.Cryptography.Pkcs

Miembro Plataformas en las que se produce
CmsSigner(CspParameters) Todos
SignerInfo.ComputeCounterSignature() Todos

System.Security.Cryptography.X509Certificates

Miembro Plataformas en las que se produce
X509Certificate(SerializationInfo, StreamingContext) Todos
X509Certificate.Import Todos
X509Certificate2(SerializationInfo, StreamingContext) Todos
X509Certificate2.PrivateKey (solo Establecer) Todos

Sistema.Seguridad.Autenticación.ProtecciónExtendida

Miembro Plataformas en las que se produce
ExtendedProtectionPolicy(SerializationInfo, StreamingContext) Todos

System.Security.Policy

Miembro Plataformas en las que se produce
Hash.GetObjectData(SerializationInfo, StreamingContext) Todos

System.ServiceProcess.ServiceController

Miembro Plataformas en las que se produce
TimeoutException(SerializationInfo, StreamingContext) Todos

System.Text.RegularExpressions

Miembro Plataformas en las que se produce
Regex.CompileToAssembly Todos

System.Threading

Miembro Plataformas en las que se produce
CompressedStack.GetObjectData(SerializationInfo, StreamingContext) Todos
ExecutionContext.GetObjectData(SerializationInfo, StreamingContext) Todos
Thread.Abort Todos
Thread.ResetAbort() Todos
Thread.Resume() Todos
Thread.Suspend() Todos

System.Xml

Miembro Plataformas en las que se produce
XmlDictionaryReader.CreateMtomReader(Byte[], Int32, Int32, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) Todos
XmlDictionaryReader.CreateMtomReader(Stream, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) Todos
XmlDictionaryWriter.CreateMtomWriter(Stream, Encoding, Int32, String, String, String, Boolean, Boolean) Todos
XsltSettings.EnableScript (cuando se establece en true) Todos

Consulte también