以下 API 始终会在所有或部分平台上的 .NET(Core)上引发异常。 在大多数情况下,引发的异常是 PlatformNotSupportedException。
本文按命名空间组织受影响的 API。
注释
- 本文是正在进行的工作。 这不是在 .NET 5+ 上引发异常的 API 的完整列表。
- 本文不包括在 .NET 5+ 上引发的二进制序列化的显式接口实现。 有关详细信息,请参阅 .NET Core 中的二进制序列化。
系统
System.CodeDom.Compiler
| 成员 | 引发异常的平台 |
|---|---|
| CodeDomProvider.CompileAssemblyFromDom | 全部 |
| CodeDomProvider.CompileAssemblyFromFile | 全部 |
| CodeDomProvider.CompileAssemblyFromSource | 全部 |
System.Collections.Specialized
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
* .NET 9 及更高版本。
System.Net.NetworkInformation
| 成员 | 引发异常的平台 |
|---|---|
| Ping.Send | Windows (UWP) |
System.Net.Sockets
| 成员 | 引发异常的平台 |
|---|---|
| Socket(SocketInformation) | 全部 |
| Socket.DuplicateAndClose(Int32) | 全部 |
System.Net.WebSockets
| 成员 | 引发异常的平台 |
|---|---|
| WebSocket.RegisterPrefixes() | 全部 |
System.Reflection
System.Runtime.CompilerServices
| 成员 | 引发异常的平台 |
|---|---|
| DebugInfoGenerator.CreatePdbGenerator() | 全部 |
System.Runtime.InteropServices
System.Runtime.Serialization
* .NET 9 及更高版本。 † .NET 8 仅适用于除 Windows 窗体和 WPF 之外的所有项目类型。
System.Security
System.Security.Claims
System.Security.Cryptography
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 | 全部 |