API:er som alltid utlöser undantag på .NET Core och .NET 5+

Följande API:er utlöser alltid ett undantag på .NET (Core) på alla eller en delmängd plattformar. I de flesta fall är PlatformNotSupportedExceptionundantaget som utlöses .

I den här artikeln ordnas de berörda API:erna efter namnområde.

Kommentar

  • Den här artikeln är ett pågående arbete. Det är inte en fullständig lista över API:er som utlöser undantag på .NET 5+.
  • Den här artikeln innehåller inte explicita gränssnittsimplementeringar för binär serialisering som utlöser .NET 5+. Mer information finns i Binär serialisering i .NET Core.

System

Medlem Plattformar som genererar
AppDomain.CreateDomain Alla
AppDomain.ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm) Alla
AppDomain.Unload(AppDomain) Alla
Console.CapsLock Linux och macOS
Console.NumberLock Linux och macOS
Delegate.GetObjectData(SerializationInfo, StreamingContext) Alla
Exception.SerializeObjectState Alla
MarshalByRefObject.GetLifetimeService() Alla
MarshalByRefObject.InitializeLifetimeService() Alla
OperatingSystem.GetObjectData(SerializationInfo, StreamingContext) Alla
Type.ReflectionOnlyGetType(String, Boolean, Boolean) Alla

System.CodeDom.Compiler

Medlem Plattformar som genererar
CodeDomProvider.CompileAssemblyFromDom Alla
CodeDomProvider.CompileAssemblyFromFile Alla
CodeDomProvider.CompileAssemblyFromSource Alla

System.Collections.Specialized

Medlem Plattformar som genererar
NameObjectCollectionBase(SerializationInfo, StreamingContext) Alla
NameObjectCollectionBase.GetObjectData(SerializationInfo, StreamingContext) Alla
NameObjectCollectionBase.OnDeserialization(Object) Alla

System.Configuration

Medlem Plattformar som genererar
System.Configuration.RsaProtectedConfigurationProvider (alla medlemmar) Alla

System.Console

Medlem Plattformar som genererar
Console.Beep() Linux och macOS
Console.BufferHeight (ange endast) Linux och macOS
Console.BufferWidth (ange endast) Linux och macOS
Console.CursorSize (ange endast) Linux och macOS
Console.CursorVisible (hämta endast) Linux och macOS
Console.MoveBufferArea Linux och macOS
Console.SetWindowPosition Linux och macOS
Console.SetWindowSize Linux och macOS
Console.Title (hämta endast) Linux och macOS
Console.WindowHeight (ange endast) Linux och macOS
Console.WindowLeft (ange endast) Linux och macOS
Console.WindowTop (ange endast) Linux och macOS
Console.WindowWidth (ange endast) Linux och macOS

System.Data.Common

Medlem Plattformar som genererar
DbDataReader.GetSchemaTable (kastar NotSupportedException) Alla

System.Diagnostics.Process

Medlem Plattformar som genererar
Process.MaxWorkingSet (ange endast) Linux
Process.MinWorkingSet (ange endast) Linux
Process.ProcessorAffinity macOS
Process.MainWindowHandle Linux och macOS
Process.Start(String, String, String, SecureString, String) Linux och macOS
Process.Start(String, String, SecureString, String) Linux och macOS
ProcessStartInfo.UserName Linux och macOS
ProcessStartInfo.PasswordInClearText Linux och macOS
ProcessStartInfo.Domain Linux och macOS
ProcessStartInfo.LoadUserProfile Linux och macOS
ProcessThread.BasePriority (ange endast) Linux och macOS
ProcessThread.BasePriority (hämta endast) macOS
ProcessThread.ProcessorAffinity (ange endast) Linux och macOS

System.IO

Medlem Plattformar som genererar
FileSystemInfo(SerializationInfo, StreamingContext) Alla
FileSystemInfo.GetObjectData(SerializationInfo, StreamingContext) Alla

System.IO.Pipes

Medlem Plattformar som genererar
NamedPipeClientStream.NumberOfServerInstances Linux och macOS
NamedPipeServerStream.GetImpersonationUserName() Linux och macOS
PipeStream.InBufferSize Linux och macOS
PipeStream.OutBufferSize Linux och macOS
PipeStream.ReadMode (ange endast) Linux och macOS
PipeStream.WaitForPipeDrain() Linux och macOS

System.Media

Medlem Plattformar som genererar
SoundPlayer(SerializationInfo, StreamingContext) Alla

System.Net

Medlem Plattformar som genererar
AuthenticationManager.Authenticate(String, WebRequest, ICredentials) Alla
AuthenticationManager.PreAuthenticate(WebRequest, ICredentials) Alla
FileWebRequest(SerializationInfo, StreamingContext) Alla
FileWebRequest.GetObjectData(SerializationInfo, StreamingContext) Alla
FileWebResponse(SerializationInfo, StreamingContext) Alla
FileWebResponse.GetObjectData(SerializationInfo, StreamingContext) Alla
HttpWebRequest(SerializationInfo, StreamingContext) Alla
HttpWebRequest.GetObjectData(SerializationInfo, StreamingContext) Alla
HttpWebResponse(SerializationInfo, StreamingContext) Alla
HttpWebResponse.GetObjectData(SerializationInfo, StreamingContext) Alla
WebProxy(SerializationInfo, StreamingContext) Alla
WebProxy.GetDefaultProxy() Alla
WebProxy.GetObjectData Alla
WebRequest(SerializationInfo, StreamingContext) Alla
WebRequest.GetObjectData(SerializationInfo, StreamingContext) Alla
WebResponse(SerializationInfo, StreamingContext) Alla
WebResponse.GetObjectData(SerializationInfo, StreamingContext) Alla

System.Net.NetworkInformation

Medlem Plattformar som genererar
Ping.Send Windows (UWP)

System.Net.Sockets

Medlem Plattformar som genererar
Socket(SocketInformation) Alla
Socket.DuplicateAndClose(Int32) Alla

System.Net.WebSockets

Medlem Plattformar som genererar
WebSocket.RegisterPrefixes() Alla

System.Reflection

Medlem Plattformar som genererar
Assembly.CodeBase Alla
Assembly.EscapedCodeBase Alla
Assembly.ReflectionOnlyLoad Alla
Assembly.ReflectionOnlyLoadFrom(String) Alla
AssemblyName.GetObjectData(SerializationInfo, StreamingContext) Alla
AssemblyName.KeyPair Alla
AssemblyName.OnDeserialization(Object) Alla
StrongNameKeyPair Alla
StrongNameKeyPair.PublicKey Alla

System.Runtime.CompilerServices

Medlem Plattformar som genererar
DebugInfoGenerator.CreatePdbGenerator() Alla

System.Runtime.InteropServices

Medlem Plattformar som genererar
IDispatchImplAttribute Alla
Marshal.GetIDispatchForObject(Object) Alla
RuntimeEnvironment.SystemConfigurationFile Alla
RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid, Guid) Alla
RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid, Guid) Alla
WindowsRuntimeMarshal.StringToHString(String) Linux och macOS
WindowsRuntimeMarshal.PtrToStringHString(IntPtr) Linux och macOS
WindowsRuntimeMarshal.FreeHString(IntPtr) Linux och macOS

System.Runtime.Serialization

Medlem Plattformar som genererar
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream, Object)* Alla
BinaryFormatter.Deserialize(Stream)* Alla
XsdDataContractExporter.Schemas Alla

* .NET 8 och senare versioner endast för alla projekttyper utom Windows Forms och WPF.

System.Security

Medlem Plattformar som genererar
CodeAccessPermission.Deny() Alla
CodeAccessPermission.PermitOnly() Alla
PermissionSet.ConvertPermissionSet(String, Byte[], String) Alla
PermissionSet.Deny() Alla
PermissionSet.PermitOnly() Alla
SecurityContext.Capture() Alla
SecurityContext.CreateCopy() Alla
SecurityContext.Dispose() Alla
SecurityContext.IsFlowSuppressed() Alla
SecurityContext.IsWindowsIdentityFlowSuppressed() Alla
SecurityContext.RestoreFlow() Alla
SecurityContext.Run(SecurityContext, ContextCallback, Object) Alla
SecurityContext.SuppressFlow() Alla
SecurityContext.SuppressFlowWindowsIdentity() Alla

System.Security.Claims

Medlem Plattformar som genererar
ClaimsPrincipal(SerializationInfo, StreamingContext) Alla
ClaimsPrincipal.GetObjectData(SerializationInfo, StreamingContext) Alla
ClaimsIdentity(SerializationInfo) Alla
ClaimsIdentity(SerializationInfo, StreamingContext) Alla
ClaimsIdentity.GetObjectData(SerializationInfo, StreamingContext) Alla

System.Security.Cryptography

Medlem Plattformar som genererar
AsymmetricAlgorithm.Create(String) Alla
System.Security.Cryptography.CngAlgorithm Linux och macOS
System.Security.Cryptography.CngAlgorithmGroup Linux och macOS
System.Security.Cryptography.CngKey Linux och macOS
System.Security.Cryptography.CngKeyBlobFormat Linux och macOS
System.Security.Cryptography.CngKeyCreationParameters Linux och macOS
System.Security.Cryptography.CngProvider Linux och macOS
System.Security.Cryptography.CngUIPolicy Linux och macOS
CryptoConfig.EncodeOID(String) Alla
CspKeyContainerInfo Linux och macOS
CspKeyContainerInfo.Accessible Linux och macOS
CspKeyContainerInfo.Exportable Linux och macOS
CspKeyContainerInfo.HardwareDevice Linux och macOS
CspKeyContainerInfo.KeyContainerName Linux och macOS
CspKeyContainerInfo.KeyNumber Linux och macOS
CspKeyContainerInfo.MachineKeyStore Linux och macOS
CspKeyContainerInfo.Protected Linux och macOS
CspKeyContainerInfo.ProviderName Linux och macOS
CspKeyContainerInfo.ProviderType Linux och macOS
CspKeyContainerInfo.RandomlyGenerated Linux och macOS
CspKeyContainerInfo.Removable Linux och macOS
CspKeyContainerInfo.UniqueKeyContainerName Linux och macOS
ECDiffieHellmanCng.FromXmlString(String, ECKeyXmlFormat) Alla
ECDiffieHellmanCng.ToXmlString(ECKeyXmlFormat) Alla
ECDiffieHellmanCngPublicKey.FromXmlString(String) Alla
ECDiffieHellmanCngPublicKey.ToXmlString() Alla
ECDiffieHellmanPublicKey.ToByteArray() Linux och macOS
ECDiffieHellmanPublicKey.ToXmlString() Alla
ECDsaCng.FromXmlString(String, ECKeyXmlFormat) Alla
ECDsaCng.ToXmlString(ECKeyXmlFormat) Alla
HashAlgorithm.Create() Alla
HMAC.Create() Alla
HMAC.Create(String) Alla
HMAC.HashCore Alla
HMAC.HashFinal Alla
HMAC.Initialize Alla
KeyedHashAlgorithm.Create() Alla
KeyedHashAlgorithm.Create(String) Alla
ProtectedData.Protect Linux och macOS
ProtectedData.Unprotect Linux och macOS
System.Security.Cryptography.RSACryptoServiceProvider.DecryptValue(Byte[]) Alla
System.Security.Cryptography.RSACryptoServiceProvider.EncryptValue(Byte[]) Alla
System.Security.Cryptography.RSA.DecryptValue(Byte[]) Alla
System.Security.Cryptography.RSA.EncryptValue(Byte[]) Alla
RSA.FromXmlString Alla
RSA.ToXmlString Alla
SymmetricAlgorithm.Create() Alla
SymmetricAlgorithm.Create(String) Alla

System.Security.Cryptography.Pkcs

Medlem Plattformar som genererar
CmsSigner(CspParameters) Alla
SignerInfo.ComputeCounterSignature() Alla

System.Security.Cryptography.X509Certificates

Medlem Plattformar som genererar
X509Certificate(SerializationInfo, StreamingContext) Alla
X509Certificate.Import Alla
X509Certificate2(SerializationInfo, StreamingContext) Alla
X509Certificate2.PrivateKey (ange endast) Alla

System.Security.Authentication.ExtendedProtection

Medlem Plattformar som genererar
ExtendedProtectionPolicy(SerializationInfo, StreamingContext) Alla

System.Security.Policy

Medlem Plattformar som genererar
Hash.GetObjectData(SerializationInfo, StreamingContext) Alla

System.ServiceProcess.ServiceController

Medlem Plattformar som genererar
TimeoutException(SerializationInfo, StreamingContext) Alla

System.Text.RegularExpressions

Medlem Plattformar som genererar
Regex.CompileToAssembly Alla

System.Threading

Medlem Plattformar som genererar
CompressedStack.GetObjectData(SerializationInfo, StreamingContext) Alla
ExecutionContext.GetObjectData(SerializationInfo, StreamingContext) Alla
Thread.Abort Alla
Thread.ResetAbort() Alla
Thread.Resume() Alla
Thread.Suspend() Alla

System.xml

Medlem Plattformar som genererar
XmlDictionaryReader.CreateMtomReader(Byte[], Int32, Int32, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) Alla
XmlDictionaryReader.CreateMtomReader(Stream, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) Alla
XmlDictionaryWriter.CreateMtomWriter(Stream, Encoding, Int32, String, String, String, Boolean, Boolean) Alla

Se även