APIs que sempre geram exceções no .NET Core e no .NET 5+

As APIs a seguir sempre vão gerar uma exceção no .NET 5 (Core) em todas 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 se trata de 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, confira Serialização binária no .NET Core.

Sistema

Membro Plataformas que geram
AppDomain.CreateDomain Tudo
AppDomain.ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm) Tudo
AppDomain.Unload(AppDomain) Tudo
Console.CapsLock Linux e macOS
Console.NumberLock Linux e macOS
Delegate.GetObjectData(SerializationInfo, StreamingContext) Tudo
Exception.SerializeObjectState Tudo
MarshalByRefObject.GetLifetimeService() Tudo
MarshalByRefObject.InitializeLifetimeService() Tudo
OperatingSystem.GetObjectData(SerializationInfo, StreamingContext) Tudo
Type.ReflectionOnlyGetType(String, Boolean, Boolean) Tudo

System.CodeDom.Compiler

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

System.Collections.Specialized

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

System.Configuration

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

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) Tudo

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) Tudo
FileSystemInfo.GetObjectData(SerializationInfo, StreamingContext) Tudo

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) Tudo

System.Net

Membro Plataformas que geram
AuthenticationManager.Authenticate(String, WebRequest, ICredentials) Tudo
AuthenticationManager.PreAuthenticate(WebRequest, ICredentials) Tudo
FileWebRequest(SerializationInfo, StreamingContext) Tudo
FileWebRequest.GetObjectData(SerializationInfo, StreamingContext) Tudo
FileWebResponse(SerializationInfo, StreamingContext) Tudo
FileWebResponse.GetObjectData(SerializationInfo, StreamingContext) Tudo
HttpWebRequest(SerializationInfo, StreamingContext) Tudo
HttpWebRequest.GetObjectData(SerializationInfo, StreamingContext) Tudo
HttpWebResponse(SerializationInfo, StreamingContext) Tudo
HttpWebResponse.GetObjectData(SerializationInfo, StreamingContext) Tudo
WebProxy(SerializationInfo, StreamingContext) Tudo
WebProxy.GetDefaultProxy() Tudo
WebProxy.GetObjectData Tudo
WebRequest(SerializationInfo, StreamingContext) Tudo
WebRequest.GetObjectData(SerializationInfo, StreamingContext) Tudo
WebResponse(SerializationInfo, StreamingContext) Tudo
WebResponse.GetObjectData(SerializationInfo, StreamingContext) Tudo

System.Net.NetworkInformation

Membro Plataformas que geram
Ping.Send Windows (UWP)

System.Net.Sockets

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

System.Net.WebSockets

Membro Plataformas que geram
WebSocket.RegisterPrefixes() Tudo

{1>System.Reflection<1}

Membro Plataformas que geram
Assembly.CodeBase Tudo
Assembly.EscapedCodeBase Tudo
Assembly.ReflectionOnlyLoad Tudo
Assembly.ReflectionOnlyLoadFrom(String) Tudo
AssemblyName.GetObjectData(SerializationInfo, StreamingContext) Tudo
AssemblyName.KeyPair Tudo
AssemblyName.OnDeserialization(Object) Tudo
StrongNameKeyPair Tudo
StrongNameKeyPair.PublicKey Tudo

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

Membro Plataformas que geram
DebugInfoGenerator.CreatePdbGenerator() Tudo

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

Membro Plataformas que geram
IDispatchImplAttribute Tudo
Marshal.GetIDispatchForObject(Object) Tudo
RuntimeEnvironment.SystemConfigurationFile Tudo
RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid, Guid) Tudo
RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid, Guid) Tudo
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)* Tudo
BinaryFormatter.Deserialize(Stream)* Tudo
XsdDataContractExporter.Schemas Tudo

* Somente o .NET 8 e versões posteriores para todos os tipos de projeto, exceto Windows Forms e WPF.

System.Security

Membro Plataformas que geram
CodeAccessPermission.Deny() Tudo
CodeAccessPermission.PermitOnly() Tudo
PermissionSet.ConvertPermissionSet(String, Byte[], String) Tudo
PermissionSet.Deny() Tudo
PermissionSet.PermitOnly() Tudo
SecurityContext.Capture() Tudo
SecurityContext.CreateCopy() Tudo
SecurityContext.Dispose() Tudo
SecurityContext.IsFlowSuppressed() Tudo
SecurityContext.IsWindowsIdentityFlowSuppressed() Tudo
SecurityContext.RestoreFlow() Tudo
SecurityContext.Run(SecurityContext, ContextCallback, Object) Tudo
SecurityContext.SuppressFlow() Tudo
SecurityContext.SuppressFlowWindowsIdentity() Tudo

System.Security.Claims

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

System.Security.Cryptography

Membro Plataformas que geram
AsymmetricAlgorithm.Create(String) Tudo
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) Tudo
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
ECDiffieHellmanCng.FromXmlString(String, ECKeyXmlFormat) Tudo
ECDiffieHellmanCng.ToXmlString(ECKeyXmlFormat) Tudo
ECDiffieHellmanCngPublicKey.FromXmlString(String) Tudo
ECDiffieHellmanCngPublicKey.ToXmlString() Tudo
ECDiffieHellmanPublicKey.ToByteArray() Linux e macOS
ECDiffieHellmanPublicKey.ToXmlString() Tudo
ECDsaCng.FromXmlString(String, ECKeyXmlFormat) Tudo
ECDsaCng.ToXmlString(ECKeyXmlFormat) Tudo
HashAlgorithm.Create() Tudo
HMAC.Create() Tudo
HMAC.Create(String) Tudo
HMAC.HashCore Tudo
HMAC.HashFinal Tudo
HMAC.Initialize Tudo
KeyedHashAlgorithm.Create() Tudo
KeyedHashAlgorithm.Create(String) Tudo
ProtectedData.Protect Linux e macOS
ProtectedData.Unprotect Linux e macOS
System.Security.Cryptography.RSACryptoServiceProvider.DecryptValue(Byte[]) Tudo
System.Security.Cryptography.RSACryptoServiceProvider.EncryptValue(Byte[]) Tudo
System.Security.Cryptography.RSA.DecryptValue(Byte[]) Tudo
System.Security.Cryptography.RSA.EncryptValue(Byte[]) Tudo
RSA.FromXmlString Tudo
RSA.ToXmlString Tudo
SymmetricAlgorithm.Create() Tudo
SymmetricAlgorithm.Create(String) Tudo

System.Security.Cryptography.Pkcs

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

System.Security.Cryptography.X509Certificates

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

System.Security.Authentication.ExtendedProtection

Membro Plataformas que geram
ExtendedProtectionPolicy(SerializationInfo, StreamingContext) Tudo

System.Security.Policy

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

System.ServiceProcess.ServiceController

Membro Plataformas que geram
TimeoutException(SerializationInfo, StreamingContext) Tudo

System.Text.RegularExpressions

Membro Plataformas que geram
Regex.CompileToAssembly Tudo

System.Threading

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

System.Xml

Membro Plataformas que geram
XmlDictionaryReader.CreateMtomReader(Byte[], Int32, Int32, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) Tudo
XmlDictionaryReader.CreateMtomReader(Stream, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) Tudo
XmlDictionaryWriter.CreateMtomWriter(Stream, Encoding, Int32, String, String, String, Boolean, Boolean) Tudo

Confira também