API, которые всегда создают исключения в .NET Core и .NET версии 5 и более поздних

Следующие API всегда вызывают исключение для .NET (Core) на всех или подмножествах платформ. В большинстве случаев создается исключение PlatformNotSupportedException.

В этой статье затронутые API упорядочиваются по пространствам имен.

Примечание.

  • Эта статья все еще находится в процессе написания. Это не полный список API-интерфейсов, создающих исключения в .NET версии 5 и более поздних.
  • В этой статье не рассматриваются явные реализации интерфейса для двоичной сериализации, которые вызываются в .NET версии 5 и более поздних. Дополнительные сведения см. в разделе Двоичная сериализация в .NET Core.

Системные

Элемент Платформы, которые вызывают исключение
AppDomain.CreateDomain Все
AppDomain.ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm) Все
AppDomain.Unload(AppDomain) Все
Console.CapsLock Linux и macOS
Console.NumberLock Linux и macOS
Delegate.GetObjectData(SerializationInfo, StreamingContext) Все
Exception.SerializeObjectState Все
MarshalByRefObject.GetLifetimeService() Все
MarshalByRefObject.InitializeLifetimeService() Все
OperatingSystem.GetObjectData(SerializationInfo, StreamingContext) Все
Type.ReflectionOnlyGetType(String, Boolean, Boolean) Все

System.CodeDom.Compiler

Элемент Платформы, которые вызывают исключение
CodeDomProvider.CompileAssemblyFromDom Все
CodeDomProvider.CompileAssemblyFromFile Все
CodeDomProvider.CompileAssemblyFromSource Все

System.Collections.Specialized

Элемент Платформы, которые вызывают исключение
NameObjectCollectionBase(SerializationInfo, StreamingContext) Все
NameObjectCollectionBase.GetObjectData(SerializationInfo, StreamingContext) Все
NameObjectCollectionBase.OnDeserialization(Object) Все

System.Configuration

Элемент Платформы, которые вызывают исключение
System.Configuration.RsaProtectedConfigurationProvider (все члены) Все

System.Console

Элемент Платформы, которые вызывают исключение
Console.Beep() Linux и macOS
Console.BufferHeight (только установка) Linux и macOS
Console.BufferWidth (только установка) Linux и macOS
Console.CursorSize (только установка) Linux и macOS
Console.CursorVisible (только получение) Linux и macOS
Console.MoveBufferArea Linux и macOS
Console.SetWindowPosition Linux и macOS
Console.SetWindowSize Linux и macOS
Console.Title (только получение) Linux и macOS
Console.WindowHeight (только установка) Linux и macOS
Console.WindowLeft (только установка) Linux и macOS
Console.WindowTop (только установка) Linux и macOS
Console.WindowWidth (только установка) Linux и macOS

System.Data.Common

Элемент Платформы, которые вызывают исключение
DbDataReader.GetSchemaTable (вызывает NotSupportedException) Все

System.Diagnostics.Process

Элемент Платформы, которые вызывают исключение
Process.MaxWorkingSet (только установка) Linux
Process.MinWorkingSet (только установка) Linux
Process.ProcessorAffinity macOS
Process.MainWindowHandle Linux и macOS
Process.Start(String, String, String, SecureString, String) Linux и macOS
Process.Start(String, String, SecureString, String) Linux и macOS
ProcessStartInfo.UserName Linux и macOS
ProcessStartInfo.PasswordInClearText Linux и macOS
ProcessStartInfo.Domain Linux и macOS
ProcessStartInfo.LoadUserProfile Linux и macOS
ProcessThread.BasePriority (только установка) Linux и macOS
ProcessThread.BasePriority (только получение) macOS
ProcessThread.ProcessorAffinity (только установка) Linux и macOS

System.IO

Элемент Платформы, которые вызывают исключение
FileSystemInfo(SerializationInfo, StreamingContext) Все
FileSystemInfo.GetObjectData(SerializationInfo, StreamingContext) Все

System.IO.Pipes

Элемент Платформы, которые вызывают исключение
NamedPipeClientStream.NumberOfServerInstances Linux и macOS
NamedPipeServerStream.GetImpersonationUserName() Linux и macOS
PipeStream.InBufferSize Linux и macOS
PipeStream.OutBufferSize Linux и macOS
PipeStream.ReadMode (только установка) Linux и macOS
PipeStream.WaitForPipeDrain() Linux и macOS

System.Media

Элемент Платформы, которые вызывают исключение
SoundPlayer(SerializationInfo, StreamingContext) Все

System.Net

Элемент Платформы, которые вызывают исключение
AuthenticationManager.Authenticate(String, WebRequest, ICredentials) Все
AuthenticationManager.PreAuthenticate(WebRequest, ICredentials) Все
FileWebRequest(SerializationInfo, StreamingContext) Все
FileWebRequest.GetObjectData(SerializationInfo, StreamingContext) Все
FileWebResponse(SerializationInfo, StreamingContext) Все
FileWebResponse.GetObjectData(SerializationInfo, StreamingContext) Все
HttpWebRequest(SerializationInfo, StreamingContext) Все
HttpWebRequest.GetObjectData(SerializationInfo, StreamingContext) Все
HttpWebResponse(SerializationInfo, StreamingContext) Все
HttpWebResponse.GetObjectData(SerializationInfo, StreamingContext) Все
WebProxy(SerializationInfo, StreamingContext) Все
WebProxy.GetDefaultProxy() Все
WebProxy.GetObjectData Все
WebRequest(SerializationInfo, StreamingContext) Все
WebRequest.GetObjectData(SerializationInfo, StreamingContext) Все
WebResponse(SerializationInfo, StreamingContext) Все
WebResponse.GetObjectData(SerializationInfo, StreamingContext) Все

System.Net.NetworkInformation

Элемент Платформы, которые вызывают исключение
Ping.Send Windows (UWP)

System.Net.Sockets

Элемент Платформы, которые вызывают исключение
Socket(SocketInformation) Все
Socket.DuplicateAndClose(Int32) Все

System.Net.WebSockets

Элемент Платформы, которые вызывают исключение
WebSocket.RegisterPrefixes() Все

System.Reflection

Элемент Платформы, которые вызывают исключение
Assembly.CodeBase Все
Assembly.EscapedCodeBase Все
Assembly.ReflectionOnlyLoad Все
Assembly.ReflectionOnlyLoadFrom(String) Все
AssemblyName.GetObjectData(SerializationInfo, StreamingContext) Все
AssemblyName.KeyPair Все
AssemblyName.OnDeserialization(Object) Все
StrongNameKeyPair Все
StrongNameKeyPair.PublicKey Все

System.Runtime.CompilerServices

Элемент Платформы, которые вызывают исключение
DebugInfoGenerator.CreatePdbGenerator() Все

System.Runtime.InteropServices

Элемент Платформы, которые вызывают исключение
IDispatchImplAttribute Все
Marshal.GetIDispatchForObject(Object) Все
RuntimeEnvironment.SystemConfigurationFile Все
RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid, Guid) Все
RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid, Guid) Все
WindowsRuntimeMarshal.StringToHString(String) Linux и macOS
WindowsRuntimeMarshal.PtrToStringHString(IntPtr) Linux и macOS
WindowsRuntimeMarshal.FreeHString(IntPtr) Linux и macOS

System.Runtime.Serialization

Элемент Платформы, которые вызывают исключение
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream, Object)* Все
BinaryFormatter.Deserialize(Stream)* Все
XsdDataContractExporter.Schemas Все

* .NET 8 и более поздних версий только для всех типов проектов, кроме Windows Forms и WPF.

System.Security

Элемент Платформы, которые вызывают исключение
CodeAccessPermission.Deny() Все
CodeAccessPermission.PermitOnly() Все
PermissionSet.ConvertPermissionSet(String, Byte[], String) Все
PermissionSet.Deny() Все
PermissionSet.PermitOnly() Все
SecurityContext.Capture() Все
SecurityContext.CreateCopy() Все
SecurityContext.Dispose() Все
SecurityContext.IsFlowSuppressed() Все
SecurityContext.IsWindowsIdentityFlowSuppressed() Все
SecurityContext.RestoreFlow() Все
SecurityContext.Run(SecurityContext, ContextCallback, Object) Все
SecurityContext.SuppressFlow() Все
SecurityContext.SuppressFlowWindowsIdentity() Все

System.Security.Claims

Элемент Платформы, которые вызывают исключение
ClaimsPrincipal(SerializationInfo, StreamingContext) Все
ClaimsPrincipal.GetObjectData(SerializationInfo, StreamingContext) Все
ClaimsIdentity(SerializationInfo) Все
ClaimsIdentity(SerializationInfo, StreamingContext) Все
ClaimsIdentity.GetObjectData(SerializationInfo, StreamingContext) Все

System.Security.Cryptography

Элемент Платформы, которые вызывают исключение
AsymmetricAlgorithm.Create(String) Все
System.Security.Cryptography.CngAlgorithm Linux и macOS
System.Security.Cryptography.CngAlgorithmGroup Linux и macOS
System.Security.Cryptography.CngKey Linux и macOS
System.Security.Cryptography.CngKeyBlobFormat Linux и macOS
System.Security.Cryptography.CngKeyCreationParameters Linux и macOS
System.Security.Cryptography.CngProvider Linux и macOS
System.Security.Cryptography.CngUIPolicy Linux и macOS
CryptoConfig.EncodeOID(String) Все
CspKeyContainerInfo Linux и macOS
CspKeyContainerInfo.Accessible Linux и macOS
CspKeyContainerInfo.Exportable Linux и macOS
CspKeyContainerInfo.HardwareDevice Linux и macOS
CspKeyContainerInfo.KeyContainerName Linux и macOS
CspKeyContainerInfo.KeyNumber Linux и macOS
CspKeyContainerInfo.MachineKeyStore Linux и macOS
CspKeyContainerInfo.Protected Linux и macOS
CspKeyContainerInfo.ProviderName Linux и macOS
CspKeyContainerInfo.ProviderType Linux и macOS
CspKeyContainerInfo.RandomlyGenerated Linux и macOS
CspKeyContainerInfo.Removable Linux и macOS
CspKeyContainerInfo.UniqueKeyContainerName Linux и macOS
ECDiffieHellmanCng.FromXmlString(String, ECKeyXmlFormat) Все
ECDiffieHellmanCng.ToXmlString(ECKeyXmlFormat) Все
ECDiffieHellmanCngPublicKey.FromXmlString(String) Все
ECDiffieHellmanCngPublicKey.ToXmlString() Все
ECDiffieHellmanPublicKey.ToByteArray() Linux и macOS
ECDiffieHellmanPublicKey.ToXmlString() Все
ECDsaCng.FromXmlString(String, ECKeyXmlFormat) Все
ECDsaCng.ToXmlString(ECKeyXmlFormat) Все
HashAlgorithm.Create() Все
HMAC.Create() Все
HMAC.Create(String) Все
HMAC.HashCore Все
HMAC.HashFinal Все
HMAC.Initialize Все
KeyedHashAlgorithm.Create() Все
KeyedHashAlgorithm.Create(String) Все
ProtectedData.Protect Linux и macOS
ProtectedData.Unprotect Linux и macOS
System.Security.Cryptography.RSACryptoServiceProvider.DecryptValue(Byte[]) Все
System.Security.Cryptography.RSACryptoServiceProvider.EncryptValue(Byte[]) Все
System.Security.Cryptography.RSA.DecryptValue(Byte[]) Все
System.Security.Cryptography.RSA.EncryptValue(Byte[]) Все
RSA.FromXmlString Все
RSA.ToXmlString Все
SymmetricAlgorithm.Create() Все
SymmetricAlgorithm.Create(String) Все

System.Security.Cryptography.Pkcs

Элемент Платформы, которые вызывают исключение
CmsSigner(CspParameters) Все
SignerInfo.ComputeCounterSignature() Все

System.Security.Cryptography.X509Certificates

Элемент Платформы, которые вызывают исключение
X509Certificate(SerializationInfo, StreamingContext) Все
X509Certificate.Import Все
X509Certificate2(SerializationInfo, StreamingContext) Все
X509Certificate2.PrivateKey (только установка) Все

System.Security.Authentication.ExtendedProtection

Элемент Платформы, которые вызывают исключение
ExtendedProtectionPolicy(SerializationInfo, StreamingContext) Все

System.Security.Policy

Элемент Платформы, которые вызывают исключение
Hash.GetObjectData(SerializationInfo, StreamingContext) Все

System.ServiceProcess.ServiceController

Элемент Платформы, которые вызывают исключение
TimeoutException(SerializationInfo, StreamingContext) Все

System.Text.RegularExpressions

Элемент Платформы, которые вызывают исключение
Regex.CompileToAssembly Все

System.Threading

Элемент Платформы, которые вызывают исключение
CompressedStack.GetObjectData(SerializationInfo, StreamingContext) Все
ExecutionContext.GetObjectData(SerializationInfo, StreamingContext) Все
Thread.Abort Все
Thread.ResetAbort() Все
Thread.Resume() Все
Thread.Suspend() Все

System.Xml

Элемент Платформы, которые вызывают исключение
XmlDictionaryReader.CreateMtomReader(Byte[], Int32, Int32, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) Все
XmlDictionaryReader.CreateMtomReader(Stream, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) Все
XmlDictionaryWriter.CreateMtomWriter(Stream, Encoding, Int32, String, String, String, Boolean, Boolean) Все

См. также