APIs that always throw exceptions on .NET Core

The following APIs will always throw a PlatformNotSupportedException on .NET Core on all or a subset of platforms.

This article organizes the affected API members by namespace.

Note

  • This article is a work-in-progress. It is not a complete list of APIs that throw exceptions on .NET Core.
  • This article does not include the explicit interface implementations for binary serialization that throw on .NET Core. For more information, see Binary serialization in .NET Core.

System

Member Platforms that throw
AppDomain.CreateDomain All
AppDomain.ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm) All
Console.CapsLock Linux and macOS
Console.NumberLock Linux and macOS
Delegate.GetObjectData(SerializationInfo, StreamingContext) All
Exception.SerializeObjectState All
MarshalByRefObject.GetLifetimeService() All
MarshalByRefObject.InitializeLifetimeService() All
OperatingSystem.GetObjectData(SerializationInfo, StreamingContext) All
Type.ReflectionOnlyGetType(String, Boolean, Boolean) All

System.CodeDom.Compiler

Member Platforms that throw
CodeDomProvider.CompileAssemblyFromDom All
CodeDomProvider.CompileAssemblyFromFile All
CodeDomProvider.CompileAssemblyFromSource All

System.Collections.Specialized

Member Platforms that throw
NameObjectCollectionBase.NameObjectCollectionBase(SerializationInfo, StreamingContext) All
NameObjectCollectionBase.GetObjectData(SerializationInfo, StreamingContext) All
NameObjectCollectionBase.OnDeserialization(Object) All

System.Configuration

Member Platforms that throw
System.Configuration.RsaProtectedConfigurationProvider (all members) All

System.Console

Member Platforms that throw
Console.Beep() Linux and macOS
Console.BufferHeight (set only) Linux and macOS
Console.BufferWidth (set only) Linux and macOS
Console.CursorSize (set only) Linux and macOS
Console.CursorVisible (get only) Linux and macOS
Console.MoveBufferArea Linux and macOS
Console.SetWindowPosition Linux and macOS
Console.SetWindowSize Linux and macOS
Console.Title (get only) Linux and macOS
Console.WindowHeight (set only) Linux and macOS
Console.WindowLeft (set only) Linux and macOS
Console.WindowTop (set only) Linux and macOS
Console.WindowWidth (set only) Linux and macOS

System.Data.Common

Member Platforms that throw
DbDataReader.GetSchemaTable (throws NotSupportedException) All

System.Diagnostics.Process

Member Platforms that throw
Process.MaxWorkingSet (set only) Linux
Process.MinWorkingSet (set only) Linux
Process.ProcessorAffinity macOS
Process.MainWindowHandle Linux and macOS
Process.Start Linux and macOS
ProcessStartInfo.UserName Linux and macOS
ProcessStartInfo.PasswordInClearText Linux and macOS
ProcessStartInfo.Domain Linux and macOS
ProcessStartInfo.LoadUserProfile Linux and macOS
ProcessThread.BasePriority (set only) Linux and macOS
ProcessThread.BasePriority (get only) macOS
ProcessThread.ProcessorAffinity (set only) Linux and macOS

System.IO

Member Platforms that throw
FileSystemInfo.FileSystemInfo(SerializationInfo, StreamingContext) All
FileSystemInfo.GetObjectData(SerializationInfo, StreamingContext) All

System.IO.Pipes

Member Platforms that throw
NamedPipeClientStream.NumberOfServerInstances Linux and macOS
NamedPipeServerStream.GetImpersonationUserName() Linux and macOS
PipeStream.InBufferSize Linux and macOS
PipeStream.OutBufferSize Linux and macOS
PipeStream.ReadMode (set only) Linux and macOS
PipeStream.WaitForPipeDrain() Linux and macOS

System.Media

Member Platforms that throw
SoundPlayer.SoundPlayer(SerializationInfo, StreamingContext) All

System.Net

Member Platforms that throw
AuthenticationManager.Authenticate(String, WebRequest, ICredentials) All
AuthenticationManager.PreAuthenticate(WebRequest, ICredentials) All
FileWebRequest.FileWebRequest(SerializationInfo, StreamingContext) All
FileWebRequest.GetObjectData(SerializationInfo, StreamingContext) All
FileWebResponse.FileWebResponse(SerializationInfo, StreamingContext) All
FileWebResponse.GetObjectData(SerializationInfo, StreamingContext) All
HttpWebRequest.HttpWebRequest(SerializationInfo, StreamingContext) All
HttpWebRequest.GetObjectData(SerializationInfo, StreamingContext) All
HttpWebResponse.HttpWebResponse(SerializationInfo, StreamingContext) All
HttpWebResponse.GetObjectData(SerializationInfo, StreamingContext) All
WebProxy.WebProxy(SerializationInfo, StreamingContext) All
WebProxy.GetDefaultProxy() All
WebProxy.GetObjectData All
WebRequest.WebRequest(SerializationInfo, StreamingContext) All
WebRequest.GetObjectData(SerializationInfo, StreamingContext) All
WebResponse.WebResponse(SerializationInfo, StreamingContext) All
WebResponse.GetObjectData(SerializationInfo, StreamingContext) All

System.Net.NetworkInformation

Member Platforms that throw
Ping.Send Windows (UWP)

System.Net.Sockets

Member Platforms that throw
Socket.Socket(SocketInformation) All
Socket.DuplicateAndClose(Int32) All

System.Net.WebSockets

Member Platforms that throw
WebSocket.RegisterPrefixes() All

System.Reflection

Member Platforms that throw
Assembly.ReflectionOnlyLoad All
Assembly.ReflectionOnlyLoadFrom(String) All
AssemblyName.GetObjectData(SerializationInfo, StreamingContext) All
AssemblyName.OnDeserialization(Object) All
StrongNameKeyPair.StrongNameKeyPair(String) All
StrongNameKeyPair.StrongNameKeyPair(SerializationInfo, StreamingContext) All
StrongNameKeyPair.PublicKey All

System.Runtime.CompilerServices

Member Platforms that throw
DebugInfoGenerator.CreatePdbGenerator() All

System.Runtime.InteropServices

Member Platforms that throw
Marshal.GetIDispatchForObject(Object) All
RuntimeEnvironment.SystemConfigurationFile All
RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid, Guid) All
RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid, Guid) All
WindowsRuntimeMarshal.StringToHString(String) Linux and macOS
WindowsRuntimeMarshal.PtrToStringHString(IntPtr) Linux and macOS
WindowsRuntimeMarshal.FreeHString(IntPtr) Linux and macOS

System.Runtime.Serialization

Member Platforms that throw
XsdDataContractExporter.Schemas All

System.Security

Member Platforms that throw
CodeAccessPermission.Deny() All
CodeAccessPermission.PermitOnly() All
PermissionSet.ConvertPermissionSet(String, Byte[], String) All
PermissionSet.Deny() All
PermissionSet.PermitOnly() All
SecurityContext.Capture() All
SecurityContext.CreateCopy() All
SecurityContext.Dispose() All
SecurityContext.IsFlowSuppressed() All
SecurityContext.IsWindowsIdentityFlowSuppressed() All
SecurityContext.RestoreFlow() All
SecurityContext.Run(SecurityContext, ContextCallback, Object) All
SecurityContext.SuppressFlow() All
SecurityContext.SuppressFlowWindowsIdentity() All

System.Security.Claims

Member Platforms that throw
ClaimsPrincipal.ClaimsPrincipal() All
ClaimsPrincipal.GetObjectData(SerializationInfo, StreamingContext) All
ClaimsIdentity.ClaimsIdentity(SerializationInfo) All
ClaimsIdentity.ClaimsIdentity(SerializationInfo, StreamingContext) All
ClaimsIdentity.GetObjectData(SerializationInfo, StreamingContext) All

System.Security.Cryptography

Member Platforms that throw
AsymmetricAlgorithm.Create(String) All
CspKeyContainerInfo.CspKeyContainerInfo Linux and macOS
CspKeyContainerInfo.Accessible Linux and macOS
CspKeyContainerInfo.Exportable Linux and macOS
CspKeyContainerInfo.HardwareDevice Linux and macOS
CspKeyContainerInfo.KeyContainerName Linux and macOS
CspKeyContainerInfo.KeyNumber Linux and macOS
CspKeyContainerInfo.MachineKeyStore Linux and macOS
CspKeyContainerInfo.Protected Linux and macOS
CspKeyContainerInfo.ProviderName Linux and macOS
CspKeyContainerInfo.ProviderType Linux and macOS
CspKeyContainerInfo.RandomlyGenerated Linux and macOS
CspKeyContainerInfo.Removable Linux and macOS
CspKeyContainerInfo.UniqueKeyContainerName Linux and macOS
HashAlgorithm.Create() All
HMAC.Create() All
HMAC.Create(String) All
HMAC.HashCore All
HMAC.HashFinal All
HMAC.Initialize All
KeyedHashAlgorithm.Create() All
KeyedHashAlgorithm.Create(String) All
ProtectedData.Protect Linux and macOS
ProtectedData.Unprotect Linux and macOS
RSA.FromXmlString All
RSA.ToXmlString All
SymmetricAlgorithm.Create() All
SymmetricAlgorithm.Create(String) All

System.Security.Cryptography.Pkcs

Member Platforms that throw
CmsSigner.CmsSigner(CspParameters) All
SignedCms.ComputeSignature(CmsSigner, Boolean) All
SignerInfo.ComputeCounterSignature() All

System.Security.Cryptography.X509Certificates

Member Platforms that throw
X509Certificate.X509Certificate(SerializationInfo, StreamingContext) All
X509Certificate.Import All
X509Certificate2.X509Certificate2(SerializationInfo, StreamingContext) All
X509Certificate2.PrivateKey (set only) All

System.Security.Authentication.ExtendedProtection

Member Platforms that throw
ExtendedProtectionPolicy.ExtendedProtectionPolicy(SerializationInfo, StreamingContext) All

System.Security.Policy

Member Platforms that throw
Hash.GetObjectData(SerializationInfo, StreamingContext) All

System.ServiceProcess.ServiceController

Member Platforms that throw
TimeoutException.TimeoutException(SerializationInfo, StreamingContext) All

System.Text.RegularExpressions

Member Platforms that throw
Regex.CompileToAssembly All

System.Threading

Member Platforms that throw
CompressedStack.GetObjectData(SerializationInfo, StreamingContext) All
ExecutionContext.GetObjectData(SerializationInfo, StreamingContext) All
Thread.Abort All
Thread.ResetAbort() All
Thread.Resume() All
Thread.Suspend() All

System.Xml

Member Platforms that throw
XmlDictionaryReader.CreateMtomReader(Byte[], Int32, Int32, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) All
XmlDictionaryReader.CreateMtomReader(Stream, Encoding[], String, XmlDictionaryReaderQuotas, Int32, OnXmlDictionaryReaderClose) All
XmlDictionaryWriter.CreateMtomWriter(Stream, Encoding, Int32, String, String, String, Boolean, Boolean) All

See also