次の方法で共有


.NET Core と .NET 5 以上で常に例外を発生させる API

次の API は、すべてまたは一部のプラットフォームの .NET (Core) で常に例外をスローします。 ほとんどの場合、スローされる例外は PlatformNotSupportedException です。

この記事では、影響を受ける API を名前空間別に整理します。

  • この記事は進行中の作業です。 .NET 5 以降で例外をスローする API の完全な一覧ではありません。
  • この記事には、.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 (get のみ) Linux と macOS
Console.MoveBufferArea Linux と macOS
Console.SetWindowPosition Linux と macOS
Console.SetWindowSize Linux と macOS
Console.Title (get のみ) 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 (get のみ) 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

メンバー スローするプラットフォーム
System.Net.AuthenticationManager* 全て
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) 全て

* .NET 9 以降のバージョン。

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.LoadFrom(String, Byte[], AssemblyHashAlgorithm) 全て
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)* 全て
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream, Object) 全て
BinaryFormatter.Deserialize(Stream) 全て
XsdDataContractExporter.Schemas 全て

* .NET 9 以降のバージョン。 † .NET 8 は、Windows フォームと 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) 全て

こちらも参照ください