Compartilhar via


APIs que sempre geram exceções no .NET (Core)

As APIs a seguir sempre geram uma exceção no .NET (Core) em todos ou em um subconjunto de plataformas. Na maioria dos casos, a exceção gerada é PlatformNotSupportedException.

Este artigo organiza as APIs afetadas por namespace.

Observação

  • Este artigo é um trabalho em andamento. Não é uma lista completa de APIs que geram exceções no .NET 5+.
  • Este artigo não inclui as implementações explícitas da interface para serialização binária que geram erro no .NET 5+. Para obter mais informações, consulte Serialização binária no .NET Core.

Sistema

Membro Plataformas que geram
AppDomain.CreateDomain Todos
AppDomain.ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm) Todos
AppDomain.Unload(AppDomain) Todos
Console.CapsLock Linux e macOS
Console.NumberLock Linux e 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

Membro Plataformas que geram
CodeDomProvider.CompileAssemblyFromDom Todos
CodeDomProvider.CompileAssemblyFromFile Todos
CodeDomProvider.CompileAssemblyFromSource Todos

System.Collections.Specialized

Membro Plataformas que geram
NameObjectCollectionBase(SerializationInfo, StreamingContext) Todos
NameObjectCollectionBase.GetObjectData(SerializationInfo, StreamingContext) Todos
NameObjectCollectionBase.OnDeserialization(Object) Todos

Configuração de Sistema

Membro Plataformas que geram
System.Configuration.RsaProtectedConfigurationProvider (todos os membros) Todos

System.Console

Membro Plataformas que geram
Console.Beep() Linux e macOS
Console.BufferHeight (somente set) Linux e macOS
Console.BufferWidth (somente set) Linux e macOS
Console.CursorSize (somente set) Linux e macOS
Console.CursorVisible (somente get) Linux e macOS
Console.MoveBufferArea Linux e macOS
Console.SetWindowPosition Linux e macOS
Console.SetWindowSize Linux e macOS
Console.Title (somente get) Linux e macOS
Console.WindowHeight (somente set) Linux e macOS
Console.WindowLeft (somente set) Linux e macOS
Console.WindowTop (somente set) Linux e macOS
Console.WindowWidth (somente set) Linux e macOS

System.Data.Common

Membro Plataformas que geram
DbDataReader.GetSchemaTable (gera NotSupportedException) Todos

System.Diagnostics.Process

Membro Plataformas que geram
Process.MaxWorkingSet (somente set) Linux
Process.MinWorkingSet (somente set) Linux
Process.ProcessorAffinity macOS
Process.MainWindowHandle Linux e macOS
Process.Start(String, String, String, SecureString, String) Linux e macOS
Process.Start(String, String, SecureString, String) Linux e macOS
ProcessStartInfo.UserName Linux e macOS
ProcessStartInfo.PasswordInClearText Linux e macOS
ProcessStartInfo.Domain Linux e macOS
ProcessStartInfo.LoadUserProfile Linux e macOS
ProcessThread.BasePriority (somente set) Linux e macOS
ProcessThread.BasePriority (somente get) macOS
ProcessThread.ProcessorAffinity (somente set) Linux e macOS

System.IO

Membro Plataformas que geram
FileSystemInfo(SerializationInfo, StreamingContext) Todos
FileSystemInfo.GetObjectData(SerializationInfo, StreamingContext) Todos

System.IO.Pipes

Membro Plataformas que geram
NamedPipeClientStream.NumberOfServerInstances Linux e macOS
NamedPipeServerStream.GetImpersonationUserName() Linux e macOS
PipeStream.InBufferSize Linux e macOS
PipeStream.OutBufferSize Linux e macOS
PipeStream.ReadMode (somente set) Linux e macOS
PipeStream.WaitForPipeDrain() Linux e macOS

System.Media

Membro Plataformas que geram
SoundPlayer(SerializationInfo, StreamingContext) Todos

System.Net

Membro Plataformas que geram
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 e versões posteriores.

System.Net.NetworkInformation

Membro Plataformas que geram
Ping.Send Windows (UWP)

System.Net.Sockets

Membro Plataformas que geram
Socket(SocketInformation) Todos
Socket.DuplicateAndClose(Int32) Todos

System.Net.WebSockets

Membro Plataformas que geram
WebSocket.RegisterPrefixes() Todos

{1>System.Reflection<1}

Membro Plataformas que geram
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

{1>{2>System.Runtime.CompilerServices<2}<1}

Membro Plataformas que geram
DebugInfoGenerator.CreatePdbGenerator() Todos

{1>{2>System.Runtime.InteropServices<2}<1}

Membro Plataformas que geram
IDispatchImplAttribute Todos
Marshal.GetIDispatchForObject(Object) Todos
RuntimeEnvironment.SystemConfigurationFile Todos
RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid, Guid) Todos
RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid, Guid) Todos
WindowsRuntimeMarshal.StringToHString(String) Linux e macOS
WindowsRuntimeMarshal.PtrToStringHString(IntPtr) Linux e macOS
WindowsRuntimeMarshal.FreeHString(IntPtr) Linux e macOS

System.Runtime.Serialization

Membro Plataformas que geram
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 e versões posteriores. † .NET 8 somente para todos os tipos de projeto, exceto Windows Forms e WPF.

System.Security

Membro Plataformas que geram
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

Membro Plataformas que geram
ClaimsPrincipal(SerializationInfo, StreamingContext) Todos
ClaimsPrincipal.GetObjectData(SerializationInfo, StreamingContext) Todos
ClaimsIdentity(SerializationInfo) Todos
ClaimsIdentity(SerializationInfo, StreamingContext) Todos
ClaimsIdentity.GetObjectData(SerializationInfo, StreamingContext) Todos

Sistema.Segurança.Criptografia

Membro Plataformas que geram
AesCcm macOS
AsymmetricAlgorithm.Create(String) Todos
System.Security.Cryptography.CngAlgorithm Linux e macOS
System.Security.Cryptography.CngAlgorithmGroup Linux e macOS
System.Security.Cryptography.CngKey Linux e macOS
System.Security.Cryptography.CngKeyBlobFormat Linux e macOS
System.Security.Cryptography.CngKeyCreationParameters Linux e macOS
System.Security.Cryptography.CngProvider Linux e macOS
System.Security.Cryptography.CngUIPolicy Linux e macOS
CryptoConfig.EncodeOID(String) Todos
CspKeyContainerInfo Linux e macOS
CspKeyContainerInfo.Accessible Linux e macOS
CspKeyContainerInfo.Exportable Linux e macOS
CspKeyContainerInfo.HardwareDevice Linux e macOS
CspKeyContainerInfo.KeyContainerName Linux e macOS
CspKeyContainerInfo.KeyNumber Linux e macOS
CspKeyContainerInfo.MachineKeyStore Linux e macOS
CspKeyContainerInfo.Protected Linux e macOS
CspKeyContainerInfo.ProviderName Linux e macOS
CspKeyContainerInfo.ProviderType Linux e macOS
CspKeyContainerInfo.RandomlyGenerated Linux e macOS
CspKeyContainerInfo.Removable Linux e macOS
CspKeyContainerInfo.UniqueKeyContainerName Linux e 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 e 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 e macOS
ProtectedData.Unprotect Linux e 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 e versões posteriores.

System.Security.Cryptography.Pkcs

Membro Plataformas que geram
CmsSigner(CspParameters) Todos
SignerInfo.ComputeCounterSignature() Todos

System.Security.Cryptography.X509Certificates

Membro Plataformas que geram
X509Certificate(SerializationInfo, StreamingContext) Todos
X509Certificate.Import Todos
X509Certificate2(SerializationInfo, StreamingContext) Todos
X509Certificate2.PrivateKey (somente set) Todos

System.Security.Authentication.ExtendedProtection

Membro Plataformas que geram
ExtendedProtectionPolicy(SerializationInfo, StreamingContext) Todos

Sistema.Segurança.Política

Membro Plataformas que geram
Hash.GetObjectData(SerializationInfo, StreamingContext) Todos

System.ServiceProcess.ServiceController

Membro Plataformas que geram
TimeoutException(SerializationInfo, StreamingContext) Todos

System.Text.RegularExpressions

Membro Plataformas que geram
Regex.CompileToAssembly Todos

System.Threading

Membro Plataformas que geram
CompressedStack.GetObjectData(SerializationInfo, StreamingContext) Todos
ExecutionContext.GetObjectData(SerializationInfo, StreamingContext) Todos
Thread.Abort Todos
Thread.ResetAbort() Todos
Thread.Resume() Todos
Thread.Suspend() Todos

System.Xml

Membro Plataformas que geram
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 (quando definido como true) Todos

Consulte também