diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs index fdfc1c333e9715..8c4fdedf591caf 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs @@ -149,6 +149,7 @@ public static bool IsEntered(object obj) private static partial bool Wait(ObjectHandleOnStack obj, int millisecondsTimeout); [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static bool Wait(object obj, int millisecondsTimeout) { ArgumentNullException.ThrowIfNull(obj); diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Monitor.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Monitor.NativeAot.cs index bed275c1ea995d..dabcc95820e5bf 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Monitor.NativeAot.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Monitor.NativeAot.cs @@ -144,6 +144,7 @@ public static bool IsEntered(object obj) #region Public Wait/Pulse methods [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static bool Wait(object obj, int millisecondsTimeout) { return GetCondition(obj).Wait(millisecondsTimeout, obj); diff --git a/src/libraries/Common/src/System/Security/Cryptography/Helpers.cs b/src/libraries/Common/src/System/Security/Cryptography/Helpers.cs index d34e3a4884e6a5..3d24979f6ee556 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Helpers.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Helpers.cs @@ -38,6 +38,7 @@ internal static partial class Helpers [UnsupportedOSPlatformGuard("browser")] [UnsupportedOSPlatformGuard("wasi")] public static bool IsRC2Supported => !OperatingSystem.IsAndroid() && !OperatingSystem.IsBrowser(); + [UnsupportedOSPlatformGuard("wasi")] #else public static bool IsRC2Supported => true; #endif diff --git a/src/libraries/Microsoft.Extensions.Configuration.Xml/ref/Microsoft.Extensions.Configuration.Xml.cs b/src/libraries/Microsoft.Extensions.Configuration.Xml/ref/Microsoft.Extensions.Configuration.Xml.cs index 889044c1071661..06fc25d13a9710 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Xml/ref/Microsoft.Extensions.Configuration.Xml.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Xml/ref/Microsoft.Extensions.Configuration.Xml.cs @@ -54,6 +54,7 @@ protected XmlDocumentDecryptor() { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("Microsoft.Extensions.Configuration.Xml can use EncryptedXml which may contain XSLTs in the xml. XSLTs require dynamic code.")] [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Microsoft.Extensions.Configuration.Xml can use EncryptedXml. If you use encrypted XML files, your application might not have the algorithm implementations it needs. To avoid this problem, one option you can use is a DynamicDependency attribute to keep the algorithm implementations in your application.")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] protected virtual System.Xml.XmlReader DecryptDocumentAndCreateXmlReader(System.Xml.XmlDocument document) { throw null; } } [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("Microsoft.Extensions.Configuration.Xml can use EncryptedXml which may contain XSLTs in the xml. XSLTs require dynamic code.")] diff --git a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlDocumentDecryptor.cs b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlDocumentDecryptor.cs index 46b17fe1c9c9e8..57c2c42cc542b1 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlDocumentDecryptor.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlDocumentDecryptor.cs @@ -98,15 +98,11 @@ public XmlReader CreateDecryptingXmlReader(Stream input, XmlReaderSettings? sett /// The document. /// An XmlReader which can read the document. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [RequiresDynamicCode(RequiresDynamicCodeMessage)] [RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)] protected virtual XmlReader DecryptDocumentAndCreateXmlReader(XmlDocument document) { -#if !NETSTANDARD2_1 && !NETSTANDARD2_0 && !NETFRAMEWORK // TODO remove with https://github.com/dotnet/runtime/pull/107185 - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); -#else - #pragma warning disable CA1416 -#endif // Perform the actual decryption step, updating the XmlDocument in-place. EncryptedXml encryptedXml = _encryptedXmlFactory?.Invoke(document) ?? new EncryptedXml(document); encryptedXml.DecryptDocument(); diff --git a/src/libraries/Microsoft.Extensions.Hosting.Systemd/ref/Microsoft.Extensions.Hosting.Systemd.cs b/src/libraries/Microsoft.Extensions.Hosting.Systemd/ref/Microsoft.Extensions.Hosting.Systemd.cs index 7d1462aba00056..acb55c93c8658f 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Systemd/ref/Microsoft.Extensions.Hosting.Systemd.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.Systemd/ref/Microsoft.Extensions.Hosting.Systemd.cs @@ -34,6 +34,7 @@ public static partial class SystemdHelpers } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("maccatalyst")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] @@ -45,6 +46,7 @@ public void Dispose() { } public System.Threading.Tasks.Task WaitForStartAsync(System.Threading.CancellationToken cancellationToken) { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public partial class SystemdNotifier : Microsoft.Extensions.Hosting.Systemd.ISystemdNotifier { public SystemdNotifier() { } diff --git a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdLifetime.cs b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdLifetime.cs index 8aa4da9e839a92..8240ec66f930a5 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdLifetime.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdLifetime.cs @@ -14,6 +14,7 @@ namespace Microsoft.Extensions.Hosting.Systemd /// [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("tvos")] diff --git a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdNotifier.cs b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdNotifier.cs index a27a7c9154e675..1ea2c6ea74975e 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdNotifier.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdNotifier.cs @@ -11,6 +11,7 @@ namespace Microsoft.Extensions.Hosting.Systemd /// Provides support to notify systemd about the service status. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public class SystemdNotifier : ISystemdNotifier { private const string NOTIFY_SOCKET = "NOTIFY_SOCKET"; @@ -41,12 +42,6 @@ public void Notify(ServiceState state) return; } -#if !NETSTANDARD2_1 && !NETSTANDARD2_0 && !NETFRAMEWORK // TODO remove with https://github.com/dotnet/runtime/pull/107185 - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); -#else - #pragma warning disable CA1416 -#endif - using (var socket = new Socket(AddressFamily.Unix, SocketType.Dgram, ProtocolType.Unspecified)) { var endPoint = new UnixDomainSocketEndPoint(_socketPath!); diff --git a/src/libraries/Microsoft.Extensions.Hosting/ref/Microsoft.Extensions.Hosting.cs b/src/libraries/Microsoft.Extensions.Hosting/ref/Microsoft.Extensions.Hosting.cs index b9c2a6021282de..016826f8c54fb3 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/ref/Microsoft.Extensions.Hosting.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/ref/Microsoft.Extensions.Hosting.cs @@ -78,21 +78,25 @@ public static partial class HostingHostBuilderExtensions public static Microsoft.Extensions.Hosting.IHostBuilder ConfigureServices(this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Action configureDelegate) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static System.Threading.Tasks.Task RunConsoleAsync(this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Action configureOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static System.Threading.Tasks.Task RunConsoleAsync(this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime(this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime(this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Action configureOptions) { throw null; } diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs b/src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs index 73313d9c0203f3..df5c43d948d05c 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs @@ -340,6 +340,7 @@ internal static ServiceProviderOptions CreateDefaultServiceProviderOptions(HostB /// The same instance of the for chaining. [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder) @@ -356,6 +357,7 @@ public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder) /// The same instance of the for chaining. [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder, Action configureOptions) @@ -375,6 +377,7 @@ public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder, Act /// A that only completes when the token is triggered or shutdown is triggered. [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public static Task RunConsoleAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default) @@ -391,6 +394,7 @@ public static Task RunConsoleAsync(this IHostBuilder hostBuilder, CancellationTo /// A that only completes when the token is triggered or shutdown is triggered. [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public static Task RunConsoleAsync(this IHostBuilder hostBuilder, Action configureOptions, CancellationToken cancellationToken = default) diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs index a146865e6a80ea..b744b45f348194 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs @@ -16,6 +16,7 @@ namespace Microsoft.Extensions.Hosting.Internal /// [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public partial class ConsoleLifetime : IHostLifetime, IDisposable diff --git a/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/HttpClientBuilderExtensions.cs b/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/HttpClientBuilderExtensions.cs index fcd10d2aa0cb36..ead44492353062 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/HttpClientBuilderExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/HttpClientBuilderExtensions.cs @@ -282,6 +282,7 @@ public static IHttpClientBuilder ConfigureHttpMessageHandlerBuilder(this IHttpCl /// /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] // We can support SocketsHttpHandler on top of wasi-socket, once we have it working https://github.com/dotnet/runtime/issues/98957 public static IHttpClientBuilder UseSocketsHttpHandler(this IHttpClientBuilder builder, Action? configureHandler = null) { ThrowHelper.ThrowIfNull(builder); @@ -320,6 +321,7 @@ public static IHttpClientBuilder UseSocketsHttpHandler(this IHttpClientBuilder b /// /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static IHttpClientBuilder UseSocketsHttpHandler(this IHttpClientBuilder builder, Action configureBuilder) { ThrowHelper.ThrowIfNull(builder); diff --git a/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/SocketsHttpHandlerBuilderExtensions.cs b/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/SocketsHttpHandlerBuilderExtensions.cs index d3bb98c8a11620..ba917390d7fc0e 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/SocketsHttpHandlerBuilderExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/SocketsHttpHandlerBuilderExtensions.cs @@ -25,6 +25,7 @@ public static class SocketsHttpHandlerBuilderExtensions /// A delegate that is used to modify a . /// An that can be used to configure the handler. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] // We can support SocketsHttpHandler on top of wasi-socket, once we have it working https://github.com/dotnet/runtime/issues/98957 public static ISocketsHttpHandlerBuilder Configure(this ISocketsHttpHandlerBuilder builder, Action configure) { builder.Services.Configure(builder.Name, options => @@ -59,6 +60,7 @@ public static ISocketsHttpHandlerBuilder Configure(this ISocketsHttpHandlerBuild /// /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static ISocketsHttpHandlerBuilder Configure(this ISocketsHttpHandlerBuilder builder, IConfiguration configuration) { SocketsHttpHandlerConfiguration parsedConfig = ParseSocketsHttpHandlerConfiguration(configuration); @@ -66,6 +68,7 @@ public static ISocketsHttpHandlerBuilder Configure(this ISocketsHttpHandlerBuild } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] private static void FillFromConfig(SocketsHttpHandler handler, in SocketsHttpHandlerConfiguration config) { if (config.PooledConnectionIdleTimeout is not null) @@ -188,6 +191,7 @@ private readonly record struct SocketsHttpHandlerConfiguration } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] private static SocketsHttpHandlerConfiguration ParseSocketsHttpHandlerConfiguration(IConfiguration config) { return new SocketsHttpHandlerConfiguration() diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs index ebdce4441e2861..75185d3b3e7ff4 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs @@ -7,6 +7,7 @@ namespace Microsoft.Extensions.Logging { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static partial class ConsoleLoggerExtensions { [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -107,6 +108,7 @@ public ConsoleLoggerOptions() { } } [Microsoft.Extensions.Logging.ProviderAliasAttribute("Console")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public partial class ConsoleLoggerProvider : Microsoft.Extensions.Logging.ILoggerProvider, Microsoft.Extensions.Logging.ISupportExternalScope, System.IDisposable { public ConsoleLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor options) { } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs index 563fcacac6dadf..23d0f4d3406e53 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs @@ -9,6 +9,7 @@ namespace Microsoft.Extensions.Logging.Console { [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] internal sealed class AnsiParsingLogConsole : IConsole diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterConfigureOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterConfigureOptions.cs index 41909de809f41b..21faab6b1605dd 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterConfigureOptions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterConfigureOptions.cs @@ -21,6 +21,7 @@ internal sealed class ConsoleFormatterConfigureOptions : IConfigureOptions providerConfiguration) { _configuration = providerConfiguration.GetFormatterOptionsSection(); diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs index c030eb059e372a..f8ae9eb2fce0a6 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs @@ -14,6 +14,7 @@ namespace Microsoft.Extensions.Logging.Console /// A logger that writes messages in the console. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] internal sealed class ConsoleLogger : ILogger, IBufferedLogger { private readonly string _name; diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerConfigureOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerConfigureOptions.cs index b8cd54a488d867..1df9c19a7ce9a6 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerConfigureOptions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerConfigureOptions.cs @@ -21,6 +21,7 @@ internal sealed class ConsoleLoggerConfigureOptions : IConfigureOptions providerConfiguration) { _configuration = providerConfiguration.Configuration; diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs index 0dcdcee2a3c9ea..a9bd5adfab3e2d 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs @@ -18,6 +18,7 @@ namespace Microsoft.Extensions.Logging /// Provides extension methods for the and classes. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static partial class ConsoleLoggerExtensions { internal const string RequiresDynamicCodeMessage = "Binding TOptions to configuration values may require generating dynamic code at runtime."; @@ -175,6 +176,7 @@ internal static IConfiguration GetFormatterOptionsSection(this ILoggerProviderCo } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] internal sealed class ConsoleLoggerFormatterConfigureOptions : ConfigureFromConfigurationOptions where TOptions : ConsoleFormatterOptions where TFormatter : ConsoleFormatter @@ -188,6 +190,7 @@ public ConsoleLoggerFormatterConfigureOptions(ILoggerProviderConfiguration : ConfigurationChangeTokenSource where TOptions : ConsoleFormatterOptions where TFormatter : ConsoleFormatter diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs index 8426f51c17d601..0ae69f9782f5ad 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs @@ -12,6 +12,7 @@ namespace Microsoft.Extensions.Logging.Console { [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] internal class ConsoleLoggerProcessor : IDisposable { private readonly Queue _messageQueue; diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs index 8551e74056f4c9..6a79705d84cfe1 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs @@ -15,6 +15,7 @@ namespace Microsoft.Extensions.Logging.Console /// A provider of instances. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [ProviderAlias("Console")] public partial class ConsoleLoggerProvider : ILoggerProvider, ISupportExternalScope { diff --git a/src/libraries/System.Collections.Concurrent/ref/System.Collections.Concurrent.cs b/src/libraries/System.Collections.Concurrent/ref/System.Collections.Concurrent.cs index 5bfe38d5619a27..d4867bc89da883 100644 --- a/src/libraries/System.Collections.Concurrent/ref/System.Collections.Concurrent.cs +++ b/src/libraries/System.Collections.Concurrent/ref/System.Collections.Concurrent.cs @@ -8,6 +8,7 @@ namespace System.Collections.Concurrent { [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public partial class BlockingCollection : System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.ICollection, System.Collections.IEnumerable, System.IDisposable { public BlockingCollection() { } diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs index 8f73a1b51c9e2c..fd141d57fbcb07 100644 --- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs +++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs @@ -40,6 +40,7 @@ namespace System.Collections.Concurrent /// /// Specifies the type of elements in the collection. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [DebuggerTypeProxy(typeof(BlockingCollectionDebugView<>))] [DebuggerDisplay("Count = {Count}, Type = {_collection}")] public class BlockingCollection : IEnumerable, ICollection, IDisposable, IReadOnlyCollection @@ -1743,6 +1744,7 @@ public BlockingCollectionDebugView(BlockingCollection collection) /// Returns a snapshot of the underlying collection's elements. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] public T[] Items { diff --git a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs index 5467a62036eb90..0625144bd0f80d 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs @@ -746,8 +746,10 @@ internal LicenseManager() { } public static System.ComponentModel.LicenseContext CurrentContext { get { throw null; } set { } } public static System.ComponentModel.LicenseUsageMode UsageMode { get { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static object? CreateWithContext([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, System.ComponentModel.LicenseContext creationContext) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static object? CreateWithContext([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, System.ComponentModel.LicenseContext creationContext, object[] args) { throw null; } public static bool IsLicensed(System.Type type) { throw null; } public static bool IsValid(System.Type type) { throw null; } @@ -2390,6 +2392,7 @@ public partial class ExtendedProtectionPolicyTypeConverter : System.ComponentMod public ExtendedProtectionPolicyTypeConverter() { } public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Type? destinationType) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public override object? ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type destinationType) { throw null; } } } diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs index b672334a38375e..0955e4f973763c 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs @@ -116,6 +116,7 @@ private static void CacheProvider(Type type, LicenseProvider? provider) /// as the context in which the licensed instance can be used. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static object? CreateWithContext( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, LicenseContext creationContext) @@ -129,6 +130,7 @@ private static void CacheProvider(Type type, LicenseProvider? provider) /// instance can be used. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static object? CreateWithContext( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, LicenseContext creationContext, diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs index 9672c785a63b11..d14abe42d3be7e 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs @@ -19,10 +19,9 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen( } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) { - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 - if (destinationType == typeof(InstanceDescriptor)) { if (value is ExtendedProtectionPolicy policy) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/AggregationManager.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/AggregationManager.cs index 2dd9450c6eae50..c0beb8d3acfe98 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/AggregationManager.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/AggregationManager.cs @@ -12,6 +12,7 @@ namespace System.Diagnostics.Metrics { [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [SecuritySafeCritical] internal sealed class AggregationManager { diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs index 088295b7377a83..d12e6ab4cdbfd5 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs @@ -642,6 +642,7 @@ private bool LogError(Exception e) private static readonly char[] s_instrumentSeparators = new char[] { '\r', '\n', ',', ';' }; [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] private void ParseSpecs(string? metricsSpecs) { if (metricsSpecs == null) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs index a9bd6b28665b2b..e4518c2ca62e3e 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs @@ -171,6 +171,7 @@ private static IEnumerable> GetGarbageCollectionCounts() [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [SupportedOSPlatform("maccatalyst")] private static IEnumerable> GetCpuTime() { diff --git a/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.Counters.cs b/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.Counters.cs index 79a8e9ddd909ca..1125f3a8d49904 100644 --- a/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.Counters.cs +++ b/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.Counters.cs @@ -5,6 +5,7 @@ namespace System.Diagnostics.Tracing { #if !FEATURE_WASM_PERFTRACING [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif public abstract partial class DiagnosticCounter : System.IDisposable { @@ -18,6 +19,7 @@ public void Dispose() { } } #if !FEATURE_WASM_PERFTRACING [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif public partial class PollingCounter : System.Diagnostics.Tracing.DiagnosticCounter { @@ -26,6 +28,7 @@ public PollingCounter(string name, System.Diagnostics.Tracing.EventSource eventS } #if !FEATURE_WASM_PERFTRACING [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif public partial class IncrementingEventCounter : System.Diagnostics.Tracing.DiagnosticCounter { @@ -36,6 +39,7 @@ public void Increment(double increment = 1) { } } #if !FEATURE_WASM_PERFTRACING [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif public partial class IncrementingPollingCounter : System.Diagnostics.Tracing.DiagnosticCounter { @@ -45,6 +49,7 @@ public IncrementingPollingCounter(string name, System.Diagnostics.Tracing.EventS } #if !FEATURE_WASM_PERFTRACING [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif public partial class EventCounter : System.Diagnostics.Tracing.DiagnosticCounter { diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs index 6bffc272ee8e2d..0d32d782d07fe5 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs @@ -19,6 +19,7 @@ namespace System.Linq.Parallel /// Specifies the type of data in the channel. #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif internal sealed class AsynchronousChannel : IDisposable { diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs index 9b101fb7891327..3ff60df77de7f1 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs @@ -28,6 +28,7 @@ namespace System.Linq.Parallel /// #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif internal sealed class AsynchronousChannelMergeEnumerator : MergeEnumerator { diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs index 11bf7fd5a233ab..8612c820b88ed7 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs @@ -143,6 +143,7 @@ public IEnumerator GetEnumerator() #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif internal static AsynchronousChannel[] MakeAsynchronousChannels(int partitionCount, ParallelMergeOptions options, IntValueEvent? consumerEvent, CancellationToken cancellationToken) { diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs index 2846d016ebb4e3..8931b948908ef6 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs @@ -38,6 +38,7 @@ namespace System.Linq.Parallel /// #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif internal sealed class OrderPreservingPipeliningMergeHelper : IMergeHelper { diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs index 0e0e81ee6448a7..7d9536a1b61ab0 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs @@ -20,6 +20,7 @@ namespace System.Linq.Parallel { #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif internal sealed class OrderPreservingPipeliningSpoolingTask : SpoolingTaskBase { diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs index 2a796d57aabae1..4b14fe81f41774 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs @@ -84,6 +84,7 @@ internal static void SpoolStopAndGo( #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif internal static void SpoolPipeline( QueryTaskGroupState groupState, PartitionedStream partitions, @@ -266,6 +267,7 @@ protected override void SpoolingFinally() /// #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif internal sealed class PipelineSpoolingTask : SpoolingTaskBase { diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs index 33288424eff27f..2bd32a9b8e9d0d 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs @@ -353,6 +353,7 @@ private void QuickSortIndicesInPlace(GrowingArray keys, List #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] #endif private void MergeSortCooperatively() { diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs index 9f3dc2674aab52..7676509c3bad94 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs @@ -66,6 +66,7 @@ public static class ParallelEnumerable // be executed in parallel, but will retain PLINQ semantics (exceptions wrapped as aggregates, etc). #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.SupportedOSPlatformGuard("browser")] + [System.Runtime.Versioning.SupportedOSPlatformGuard("wasi")] internal static bool SinglePartitionMode => OperatingSystem.IsBrowser() || OperatingSystem.IsWasi(); #else internal static bool SinglePartitionMode => false; diff --git a/src/libraries/System.Net.Http/ref/System.Net.Http.cs b/src/libraries/System.Net.Http/ref/System.Net.Http.cs index 2a7f27d96be35d..42c6b7e1fecd3d 100644 --- a/src/libraries/System.Net.Http/ref/System.Net.Http.cs +++ b/src/libraries/System.Net.Http/ref/System.Net.Http.cs @@ -94,12 +94,16 @@ protected override void Dispose(bool disposing) { } public System.Threading.Tasks.Task PutAsync(System.Uri? requestUri, System.Net.Http.HttpContent? content) { throw null; } public System.Threading.Tasks.Task PutAsync(System.Uri? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public override System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } public System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request) { throw null; } public System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption) { throw null; } @@ -111,48 +115,65 @@ public partial class HttpClientHandler : System.Net.Http.HttpMessageHandler public HttpClientHandler() { } public bool AllowAutoRedirect { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Net.DecompressionMethods AutomaticDecompression { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public bool CheckCertificateRevocationList { get { throw null; } set { } } public System.Net.Http.ClientCertificateOption ClientCertificateOptions { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates { get { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Net.CookieContainer CookieContainer { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Net.ICredentials? Credentials { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static System.Func DangerousAcceptAnyServerCertificateValidator { get { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Net.ICredentials? DefaultProxyCredentials { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public int MaxAutomaticRedirections { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public int MaxConnectionsPerServer { get { throw null; } set { } } public long MaxRequestContentBufferSize { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public int MaxResponseHeadersLength { get { throw null; } set { } } [System.CLSCompliantAttribute(false)] public System.Diagnostics.Metrics.IMeterFactory? MeterFactory { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public bool PreAuthenticate { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public System.Net.IWebProxy? Proxy { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Func? ServerCertificateCustomValidationCallback { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Security.Authentication.SslProtocols SslProtocols { get { throw null; } set { } } public virtual bool SupportsAutomaticDecompression { get { throw null; } } public virtual bool SupportsProxy { get { throw null; } } public virtual bool SupportsRedirectConfiguration { get { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public bool UseCookies { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public bool UseDefaultCredentials { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public bool UseProxy { get { throw null; } set { } } protected override void Dispose(bool disposing) { } // @@ -161,6 +182,7 @@ protected override void Dispose(bool disposing) { } // //[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] //[System.Runtime.Versioning.UnsupportedOSPlatformAttributeUnsupportedOSPlatform("ios")] //[System.Runtime.Versioning.UnsupportedOSPlatformAttributeUnsupportedOSPlatform("tvos")] protected internal override System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } @@ -228,6 +250,7 @@ public HttpMessageInvoker(System.Net.Http.HttpMessageHandler handler, bool dispo public void Dispose() { } protected virtual void Dispose(bool disposing) { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public virtual System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -412,6 +435,7 @@ internal SocketsHttpConnectionContext() { } public System.Net.Http.HttpRequestMessage InitialRequestMessage { get { throw null; } } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed partial class SocketsHttpHandler : System.Net.Http.HttpMessageHandler { public SocketsHttpHandler() { } @@ -430,6 +454,7 @@ public SocketsHttpHandler() { } public System.TimeSpan Expect100ContinueTimeout { get { throw null; } set { } } public int InitialHttp2StreamWindowSize { get { throw null; } set { } } [System.Runtime.Versioning.UnsupportedOSPlatformGuardAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformGuardAttribute("wasi")] public static bool IsSupported { get { throw null; } } public System.TimeSpan KeepAlivePingDelay { get { throw null; } set { } } public System.Net.Http.HttpKeepAlivePingPolicy KeepAlivePingPolicy { get { throw null; } set { } } diff --git a/src/libraries/System.Net.Http/src/System.Net.Http.csproj b/src/libraries/System.Net.Http/src/System.Net.Http.csproj index 03123bc5adee2c..c903cd420a9694 100644 --- a/src/libraries/System.Net.Http/src/System.Net.Http.csproj +++ b/src/libraries/System.Net.Http/src/System.Net.Http.csproj @@ -437,28 +437,25 @@ Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs" /> - + - - - + + + + + + - - - - - diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/SocketsHttpHandler.cs b/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/SocketsHttpHandler.cs index 955375e3317933..4e7f975c682215 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/SocketsHttpHandler.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/SocketsHttpHandler.cs @@ -14,9 +14,11 @@ namespace System.Net.Http { [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] // We can support SocketsHttpHandler on top of wasi-socket, once we have it working https://github.com/dotnet/runtime/issues/98957 public sealed class SocketsHttpHandler : HttpMessageHandler { [UnsupportedOSPlatformGuard("browser")] + [UnsupportedOSPlatformGuard("wasi")] // We can support SocketsHttpHandler on top of wasi-socket, once we have it working https://github.com/dotnet/runtime/issues/98957 public static bool IsSupported => false; public bool UseCookies diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs index 822090c0819e1a..7d5af07c76fd51 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs @@ -449,18 +449,22 @@ public Task DeleteAsync(Uri? requestUri, CancellationToken #region Advanced Send Overloads [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public HttpResponseMessage Send(HttpRequestMessage request) => Send(request, DefaultCompletionOption, cancellationToken: default); [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public HttpResponseMessage Send(HttpRequestMessage request, HttpCompletionOption completionOption) => Send(request, completionOption, cancellationToken: default); [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) => Send(request, DefaultCompletionOption, cancellationToken); [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public HttpResponseMessage Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) { CheckRequestBeforeSend(request); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.AnyMobile.cs b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.AnyMobile.cs index 6037df88bef807..47628efb2e173f 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.AnyMobile.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.AnyMobile.cs @@ -131,6 +131,7 @@ public IMeterFactory? MeterFactory } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool UseCookies { get @@ -158,6 +159,7 @@ public bool UseCookies } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public CookieContainer CookieContainer { get @@ -187,6 +189,7 @@ public CookieContainer CookieContainer } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public ICredentials? DefaultProxyCredentials { get @@ -214,6 +217,7 @@ public ICredentials? DefaultProxyCredentials } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool UseDefaultCredentials { // SocketsHttpHandler doesn't have a separate UseDefaultCredentials property. There @@ -269,6 +273,7 @@ public bool UseDefaultCredentials } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public ICredentials? Credentials { get @@ -323,6 +328,7 @@ public bool AllowAutoRedirect } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public int MaxConnectionsPerServer { get @@ -380,6 +386,7 @@ public long MaxRequestContentBufferSize } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public int MaxResponseHeadersLength { get @@ -449,6 +456,7 @@ public ClientCertificateOption ClientCertificateOptions } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public X509CertificateCollection ClientCertificates { get @@ -471,6 +479,7 @@ public X509CertificateCollection ClientCertificates } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public Func? ServerCertificateCustomValidationCallback { get @@ -501,6 +510,7 @@ public X509CertificateCollection ClientCertificates } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool CheckCertificateRevocationList { get @@ -529,6 +539,7 @@ public bool CheckCertificateRevocationList } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public SslProtocols SslProtocols { get @@ -617,6 +628,7 @@ public virtual bool SupportsRedirectConfiguration } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public DecompressionMethods AutomaticDecompression { get @@ -671,6 +683,7 @@ public bool UseProxy } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public IWebProxy? Proxy @@ -700,6 +713,7 @@ public IWebProxy? Proxy } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool PreAuthenticate { get @@ -727,6 +741,7 @@ public bool PreAuthenticate } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public int MaxAutomaticRedirections { get @@ -759,6 +774,7 @@ public int MaxAutomaticRedirections // //[UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] //[UnsupportedOSPlatform("ios")] //[UnsupportedOSPlatform("tvos")] protected internal override HttpResponseMessage Send(HttpRequestMessage request, @@ -777,6 +793,7 @@ protected internal override Task SendAsync(HttpRequestMessa // lazy-load the validator func so it can be trimmed by the ILLinker if it isn't used. private static Func? s_dangerousAcceptAnyServerCertificateValidator; [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static Func DangerousAcceptAnyServerCertificateValidator => s_dangerousAcceptAnyServerCertificateValidator ?? Interlocked.CompareExchange(ref s_dangerousAcceptAnyServerCertificateValidator, delegate { return true; }, null) ?? diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs index afba32455bc2fe..44e60ddc9e15bc 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs @@ -116,6 +116,7 @@ public IMeterFactory? MeterFactory } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool UseCookies { get => _underlyingHandler.UseCookies; @@ -123,6 +124,7 @@ public bool UseCookies } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public CookieContainer CookieContainer { get => _underlyingHandler.CookieContainer; @@ -135,6 +137,7 @@ public CookieContainer CookieContainer } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public DecompressionMethods AutomaticDecompression { get => _underlyingHandler.AutomaticDecompression; @@ -142,6 +145,7 @@ public DecompressionMethods AutomaticDecompression } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool UseProxy { get => _underlyingHandler.UseProxy; @@ -149,6 +153,7 @@ public bool UseProxy } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public IWebProxy? Proxy @@ -158,6 +163,7 @@ public IWebProxy? Proxy } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public ICredentials? DefaultProxyCredentials { get => _underlyingHandler.DefaultProxyCredentials; @@ -165,6 +171,7 @@ public ICredentials? DefaultProxyCredentials } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool PreAuthenticate { get => _underlyingHandler.PreAuthenticate; @@ -172,6 +179,7 @@ public bool PreAuthenticate } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool UseDefaultCredentials { // SocketsHttpHandler doesn't have a separate UseDefaultCredentials property. There @@ -195,6 +203,7 @@ public bool UseDefaultCredentials } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public ICredentials? Credentials { get => _underlyingHandler.Credentials; @@ -208,6 +217,7 @@ public bool AllowAutoRedirect } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public int MaxAutomaticRedirections { get => _underlyingHandler.MaxAutomaticRedirections; @@ -215,6 +225,7 @@ public int MaxAutomaticRedirections } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public int MaxConnectionsPerServer { get => _underlyingHandler.MaxConnectionsPerServer; @@ -252,6 +263,7 @@ public long MaxRequestContentBufferSize } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public int MaxResponseHeadersLength { get => _underlyingHandler.MaxResponseHeadersLength; @@ -287,6 +299,7 @@ public ClientCertificateOption ClientCertificateOptions } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public X509CertificateCollection ClientCertificates { get @@ -302,6 +315,7 @@ public X509CertificateCollection ClientCertificates } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public Func? ServerCertificateCustomValidationCallback { #if TARGET_BROWSER || TARGET_WASI @@ -320,6 +334,7 @@ public X509CertificateCollection ClientCertificates } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool CheckCertificateRevocationList { get => _underlyingHandler.SslOptions.CertificateRevocationCheckMode == X509RevocationMode.Online; @@ -331,6 +346,7 @@ public bool CheckCertificateRevocationList } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public SslProtocols SslProtocols { get => _underlyingHandler.SslOptions.EnabledSslProtocols; @@ -349,6 +365,7 @@ public SslProtocols SslProtocols // //[UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] //[UnsupportedOSPlatform("ios")] //[UnsupportedOSPlatform("tvos")] protected internal override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) @@ -370,6 +387,7 @@ protected internal override Task SendAsync(HttpRequestMessa // lazy-load the validator func so it can be trimmed by the ILLinker if it isn't used. private static Func? s_dangerousAcceptAnyServerCertificateValidator; [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static Func DangerousAcceptAnyServerCertificateValidator => s_dangerousAcceptAnyServerCertificateValidator ?? Interlocked.CompareExchange(ref s_dangerousAcceptAnyServerCertificateValidator, delegate { return true; }, null) ?? diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/HttpMessageInvoker.cs b/src/libraries/System.Net.Http/src/System/Net/Http/HttpMessageInvoker.cs index c9e55048c802ad..093ed4d3329656 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/HttpMessageInvoker.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/HttpMessageInvoker.cs @@ -29,6 +29,7 @@ public HttpMessageInvoker(HttpMessageHandler handler, bool disposeHandler) } [UnsupportedOSPlatformAttribute("browser")] + [UnsupportedOSPlatformAttribute("wasi")] public virtual HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) { ArgumentNullException.ThrowIfNull(request); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/SocketsHttpHandler.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/SocketsHttpHandler.cs index 6c0a8208508bdb..cd4310a277c50c 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/SocketsHttpHandler.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/SocketsHttpHandler.cs @@ -16,6 +16,7 @@ namespace System.Net.Http { [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] // We can support SocketsHttpHandler on top of wasi-socket, once we have it working https://github.com/dotnet/runtime/issues/98957 public sealed class SocketsHttpHandler : HttpMessageHandler { private readonly HttpConnectionSettings _settings = new HttpConnectionSettings(); @@ -36,6 +37,7 @@ private void CheckDisposedOrStarted() /// Gets a value that indicates whether the handler is supported on the current platform. /// [UnsupportedOSPlatformGuard("browser")] + [UnsupportedOSPlatformGuard("wasi")] public static bool IsSupported => !OperatingSystem.IsBrowser() && !OperatingSystem.IsWasi(); public bool UseCookies diff --git a/src/libraries/System.Net.Mail/ref/System.Net.Mail.cs b/src/libraries/System.Net.Mail/ref/System.Net.Mail.cs index c86ac55a79b3bf..6abd3daec8d970 100644 --- a/src/libraries/System.Net.Mail/ref/System.Net.Mail.cs +++ b/src/libraries/System.Net.Mail/ref/System.Net.Mail.cs @@ -166,6 +166,7 @@ public enum MailPriority } public delegate void SendCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public partial class SmtpClient : System.IDisposable { public SmtpClient() { } diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs index 884d3b18a38669..74956f5080b878 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs @@ -33,6 +33,7 @@ public enum SmtpDeliveryFormat } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public class SmtpClient : IDisposable { private string? _host; diff --git a/src/libraries/System.Net.Requests/src/System/Net/ServicePoint/ServicePointManager.cs b/src/libraries/System.Net.Requests/src/System/Net/ServicePoint/ServicePointManager.cs index be282f8401a924..a496ca65af2bb2 100644 --- a/src/libraries/System.Net.Requests/src/System/Net/ServicePoint/ServicePointManager.cs +++ b/src/libraries/System.Net.Requests/src/System/Net/ServicePoint/ServicePointManager.cs @@ -98,6 +98,7 @@ public static int DnsRefreshTimeout public static bool CheckCertificateRevocationList { get; set; } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static EncryptionPolicy EncryptionPolicy { get; } = EncryptionPolicy.RequireEncryption; public static ServicePoint FindServicePoint(Uri address) => FindServicePoint(address, null); diff --git a/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs b/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs index 7634a76f429408..5ae281ca34791c 100644 --- a/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs +++ b/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs @@ -18,6 +18,7 @@ internal static partial class ComponentActivator [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("tvos")] @@ -56,6 +57,7 @@ private static string MarshalToString(IntPtr arg, string argName) [RequiresUnreferencedCode(TrimIncompatibleWarningMessage, Url = "https://aka.ms/dotnet-illink/nativehost")] [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("tvos")] @@ -103,6 +105,7 @@ public static unsafe int LoadAssemblyAndGetFunctionPointer(IntPtr assemblyPathNa [RequiresDynamicCode(NativeAOTIncompatibleWarningMessage)] [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("tvos")] @@ -136,6 +139,7 @@ public static unsafe int LoadAssembly(IntPtr assemblyPathNative, IntPtr loadCont [RequiresUnreferencedCode(TrimIncompatibleWarningMessage, Url = "https://aka.ms/dotnet-illink/nativehost")] [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("tvos")] @@ -173,6 +177,7 @@ private static void LoadAssemblyImpl(string assemblyPath) [RequiresDynamicCode(NativeAOTIncompatibleWarningMessage)] [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("tvos")] @@ -275,6 +280,7 @@ public static unsafe int GetFunctionPointer(IntPtr typeNameNative, [RequiresUnreferencedCode(TrimIncompatibleWarningMessage, Url = "https://aka.ms/dotnet-illink/nativehost")] [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] private static IsolatedComponentLoadContext GetIsolatedComponentLoadContext(string assemblyPath) diff --git a/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/IsolatedComponentLoadContext.cs b/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/IsolatedComponentLoadContext.cs index 94ed1f4441ba8c..d363ea7d6ffb28 100644 --- a/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/IsolatedComponentLoadContext.cs +++ b/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/IsolatedComponentLoadContext.cs @@ -16,6 +16,7 @@ namespace Internal.Runtime.InteropServices /// [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("tvos")] diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs index 53811bda9eb44a..f6b35f5494c8cb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs @@ -10,6 +10,7 @@ namespace System.Diagnostics.Tracing #if !ES_BUILD_STANDALONE #if !FEATURE_WASM_PERFTRACING [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif #endif internal sealed class CounterGroup diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/DiagnosticCounter.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/DiagnosticCounter.cs index 6a4ed0b053fdc5..fac7e5cfce804d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/DiagnosticCounter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/DiagnosticCounter.cs @@ -15,6 +15,7 @@ namespace System.Diagnostics.Tracing #if !ES_BUILD_STANDALONE #if !FEATURE_WASM_PERFTRACING [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif #endif public abstract class DiagnosticCounter : IDisposable diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventCounter.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventCounter.cs index c86088f9db41d7..2f5825a6aad1a4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventCounter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventCounter.cs @@ -19,6 +19,7 @@ namespace System.Diagnostics.Tracing #if !ES_BUILD_STANDALONE #if !FEATURE_WASM_PERFTRACING [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif #endif public partial class EventCounter : DiagnosticCounter diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingEventCounter.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingEventCounter.cs index ff41451b0af0dc..a5048a24bca935 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingEventCounter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingEventCounter.cs @@ -15,6 +15,7 @@ namespace System.Diagnostics.Tracing #if !ES_BUILD_STANDALONE #if !FEATURE_WASM_PERFTRACING [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif #endif public partial class IncrementingEventCounter : DiagnosticCounter diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingPollingCounter.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingPollingCounter.cs index b0561a451cd567..b6dfd0a96899cd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingPollingCounter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/IncrementingPollingCounter.cs @@ -17,6 +17,7 @@ namespace System.Diagnostics.Tracing #if !ES_BUILD_STANDALONE #if !FEATURE_WASM_PERFTRACING [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif #endif public partial class IncrementingPollingCounter : DiagnosticCounter diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/PollingCounter.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/PollingCounter.cs index 52196f8817fac3..80ea40f00c371e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/PollingCounter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/PollingCounter.cs @@ -16,6 +16,7 @@ namespace System.Diagnostics.Tracing #if !ES_BUILD_STANDALONE #if !FEATURE_WASM_PERFTRACING [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif #endif public partial class PollingCounter : DiagnosticCounter diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs index 6dbbfe272b25b6..3b5de86f2cd120 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs @@ -78,6 +78,7 @@ private static int CheckedSysConf(Interop.Sys.SysConfName name) [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [SupportedOSPlatform("maccatalyst")] public static ProcessCpuUsage CpuUsage { diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs index bd2cb5b10ff3f8..754a80c4c9d74a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs @@ -367,6 +367,7 @@ private static unsafe string[] SegmentCommandLine(char* cmdLine) [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [SupportedOSPlatform("maccatalyst")] public static ProcessCpuUsage CpuUsage { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs index afc824b8025e6f..e0b08e94cbeaea 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs @@ -71,6 +71,7 @@ public enum CreateObjectFlags /// [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [CLSCompliant(false)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.cs index 6cec67330022e2..31bd1f441d6a8d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.cs @@ -32,6 +32,7 @@ public sealed partial class PosixSignalRegistration : IDisposable /// [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public static PosixSignalRegistration Create(PosixSignal signal, Action handler) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.PlatformNotSupported.cs index 5f0597bf337bed..53d396c76ca834 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.PlatformNotSupported.cs @@ -8,6 +8,7 @@ namespace System.Runtime.Loader { [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public sealed class AssemblyDependencyResolver diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs index e4e6f2269a070e..0f6507df60df60 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs @@ -12,6 +12,7 @@ namespace System.Runtime.Loader { [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public sealed class AssemblyDependencyResolver diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs index a9b8c10c03318d..1ea769c854cc57 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs @@ -347,12 +347,10 @@ public void Reset() /// #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void Wait() { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif Wait(Timeout.Infinite, CancellationToken.None); } @@ -373,6 +371,7 @@ public void Wait() /// #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void Wait(CancellationToken cancellationToken) { @@ -396,6 +395,7 @@ public void Wait(CancellationToken cancellationToken) /// #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool Wait(TimeSpan timeout) { @@ -429,6 +429,7 @@ public bool Wait(TimeSpan timeout) /// #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) { @@ -455,6 +456,7 @@ public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) /// #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool Wait(int millisecondsTimeout) { @@ -481,6 +483,7 @@ public bool Wait(int millisecondsTimeout) /// name="cancellationToken"/> was canceled. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool Wait(int millisecondsTimeout, CancellationToken cancellationToken) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Monitor.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Monitor.cs index c40c38dab4f0f0..f6d6868f1a4814 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Monitor.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Monitor.cs @@ -15,17 +15,20 @@ public static void TryEnter(object obj, TimeSpan timeout, ref bool lockTaken) #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static bool Wait(object obj, TimeSpan timeout) => Wait(obj, WaitHandle.ToTimeoutMilliseconds(timeout)); #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static bool Wait(object obj) => Wait(obj, Timeout.Infinite); // Remoting is not supported, exitContext argument is unused #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static bool Wait(object obj, int millisecondsTimeout, bool exitContext) => Wait(obj, millisecondsTimeout); @@ -33,6 +36,7 @@ public static bool Wait(object obj, int millisecondsTimeout, bool exitContext) // Remoting is not supported, exitContext argument is unused #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static bool Wait(object obj, TimeSpan timeout, bool exitContext) => Wait(obj, WaitHandle.ToTimeoutMilliseconds(timeout)); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.Portable.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.Portable.cs index 74dbefe5869067..58d4a047b9cdc2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.Portable.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.Portable.cs @@ -12,6 +12,7 @@ namespace System.Threading /// #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public sealed partial class RegisteredWaitHandle : MarshalByRefObject { @@ -55,9 +56,6 @@ public sealed partial class RegisteredWaitHandle : MarshalByRefObject internal RegisteredWaitHandle(WaitHandle waitHandle, _ThreadPoolWaitOrTimerCallback callbackHelper, int millisecondsTimeout, bool repeating) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif #if WINDOWS Debug.Assert(!ThreadPool.UseWindowsThreadPool); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/SemaphoreSlim.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/SemaphoreSlim.cs index bab6bbd332b19a..df3839d9aed160 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/SemaphoreSlim.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/SemaphoreSlim.cs @@ -172,11 +172,9 @@ public SemaphoreSlim(int initialCount, int maxCount) /// The current instance has already been /// disposed. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public void Wait() { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif // Call wait with infinite timeout Wait(Timeout.Infinite, CancellationToken.None); } @@ -192,11 +190,9 @@ public void Wait() /// The current instance has already been /// disposed. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public void Wait(CancellationToken cancellationToken) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif // Call wait with infinite timeout Wait(Timeout.Infinite, cancellationToken); } @@ -214,11 +210,9 @@ public void Wait(CancellationToken cancellationToken) /// number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater /// than . [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool Wait(TimeSpan timeout) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif // Validate the timeout long totalMilliseconds = (long)timeout.TotalMilliseconds; if (totalMilliseconds < -1 || totalMilliseconds > int.MaxValue) @@ -248,11 +242,9 @@ public bool Wait(TimeSpan timeout) /// than . /// was canceled. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif // Validate the timeout long totalMilliseconds = (long)timeout.TotalMilliseconds; if (totalMilliseconds < -1 || totalMilliseconds > int.MaxValue) @@ -276,11 +268,9 @@ public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) /// is a /// negative number other than -1, which represents an infinite time-out. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool Wait(int millisecondsTimeout) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif return Wait(millisecondsTimeout, CancellationToken.None); } @@ -297,11 +287,9 @@ public bool Wait(int millisecondsTimeout) /// which represents an infinite time-out. /// was canceled. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public bool Wait(int millisecondsTimeout, CancellationToken cancellationToken) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif CheckDispose(); #if FEATURE_WASM_MANAGED_THREADS Thread.AssureBlockingPossible(); @@ -449,11 +437,9 @@ public bool Wait(int millisecondsTimeout, CancellationToken cancellationToken) /// The CancellationToken to observe. /// true if the monitor received a signal, false if the timeout expired [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] private bool WaitUntilCountOrTimeout(int millisecondsTimeout, uint startTime, CancellationToken cancellationToken) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif int remainingWaitMilliseconds = Timeout.Infinite; // Wait on the monitor as long as the count is zero diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs index a6acc125c038b5..bff25d12e8bdf0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs @@ -2967,9 +2967,6 @@ internal bool InternalWait(int millisecondsTimeout, CancellationToken cancellati // to be able to see the method on the stack and inspect arguments). private bool InternalWaitCore(int millisecondsTimeout, CancellationToken cancellationToken) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif // If the task has already completed, there's nothing to wait for. bool returnValue = IsCompleted; if (returnValue) @@ -4682,12 +4679,10 @@ internal void RemoveContinuation(object continuationObject) // could be TaskCont /// the execution of at least one of the instances. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [MethodImpl(MethodImplOptions.NoOptimization)] // this is needed for the parallel debugger public static void WaitAll(params Task[] tasks) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif if (tasks is null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.tasks); @@ -4711,11 +4706,9 @@ public static void WaitAll(params Task[] tasks) /// the execution of at least one of the instances. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static void WaitAll(params ReadOnlySpan tasks) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif bool waitResult = WaitAllCore(tasks, Timeout.Infinite, default); Debug.Assert(waitResult, "expected wait to succeed"); } @@ -4750,12 +4743,10 @@ public static void WaitAll(params ReadOnlySpan tasks) /// . /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [MethodImpl(MethodImplOptions.NoOptimization)] // this is needed for the parallel debugger public static bool WaitAll(Task[] tasks, TimeSpan timeout) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif long totalMilliseconds = (long)timeout.TotalMilliseconds; if (totalMilliseconds is < -1 or > int.MaxValue) { @@ -4797,12 +4788,10 @@ public static bool WaitAll(Task[] tasks, TimeSpan timeout) /// infinite time-out. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [MethodImpl(MethodImplOptions.NoOptimization)] // this is needed for the parallel debugger public static bool WaitAll(Task[] tasks, int millisecondsTimeout) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif if (tasks is null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.tasks); @@ -4834,12 +4823,10 @@ public static bool WaitAll(Task[] tasks, int millisecondsTimeout) /// The was canceled. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [MethodImpl(MethodImplOptions.NoOptimization)] // this is needed for the parallel debugger public static void WaitAll(Task[] tasks, CancellationToken cancellationToken) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif if (tasks is null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.tasks); @@ -4883,12 +4870,10 @@ public static void WaitAll(Task[] tasks, CancellationToken cancellationToken) /// The was canceled. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [MethodImpl(MethodImplOptions.NoOptimization)] // this is needed for the parallel debugger public static bool WaitAll(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif if (tasks is null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.tasks); @@ -4909,11 +4894,9 @@ public static bool WaitAll(Task[] tasks, int millisecondsTimeout, CancellationTo /// contains an in its collection. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static void WaitAll(IEnumerable tasks, CancellationToken cancellationToken = default) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif if (tasks is null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.tasks); @@ -4930,11 +4913,9 @@ public static void WaitAll(IEnumerable tasks, CancellationToken cancellati // Separated out to allow it to be optimized (caller is marked NoOptimization for VS parallel debugger // to be able to see the method on the stack and inspect arguments). [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] private static bool WaitAllCore(ReadOnlySpan tasks, int millisecondsTimeout, CancellationToken cancellationToken) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif if (millisecondsTimeout < -1) { ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.millisecondsTimeout); @@ -5063,11 +5044,9 @@ private static void AddToList(T item, ref List? list, int initSize) /// The cancellation token. /// true if all of the tasks completed; otherwise, false. [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] private static bool WaitAllBlockingCore(List tasks, int millisecondsTimeout, CancellationToken cancellationToken) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif Debug.Assert(tasks != null, "Expected a non-null list of tasks"); Debug.Assert(tasks.Count > 0, "Expected at least one task"); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs index 2b66d88540b1b6..fbcd45a1839da2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs @@ -24,11 +24,9 @@ public static partial class TaskAsyncEnumerableExtensions /// Async enumeration does not happen in the background; each MoveNext call will invoke the underlying exactly once. /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public static IEnumerable ToBlockingEnumerable(this IAsyncEnumerable source, CancellationToken cancellationToken = default) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif IAsyncEnumerator enumerator = source.GetAsyncEnumerator(cancellationToken); // A ManualResetEventSlim variant that lets us reuse the same // awaiter callback allocation across the entire enumeration. @@ -80,11 +78,9 @@ public ManualResetEventWithAwaiterSupport() } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public void Wait(TAwaiter awaiter) where TAwaiter : ICriticalNotifyCompletion { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif awaiter.UnsafeOnCompleted(_onCompleted); Wait(); Reset(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs index ed4aaf75758075..2af73fd5cdc20c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs @@ -184,6 +184,7 @@ internal static void ThrowIfNoThreadStart(bool internalThread = false) /// This thread was created using a delegate instead of a delegate. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void Start(object? parameter) => Start(parameter, captureContext: true); @@ -198,14 +199,12 @@ internal static void ThrowIfNoThreadStart(bool internalThread = false) /// #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void UnsafeStart(object? parameter) => Start(parameter, captureContext: false); private void Start(object? parameter, bool captureContext, bool internalThread = false) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif ThrowIfNoThreadStart(internalThread); StartHelper? startHelper = _startHelper; @@ -232,6 +231,7 @@ private void Start(object? parameter, bool captureContext, bool internalThread = /// There is not enough memory available to start this thread. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void Start() => Start(captureContext: true); @@ -244,6 +244,7 @@ private void Start(object? parameter, bool captureContext, bool internalThread = /// #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void UnsafeStart() => Start(captureContext: false); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs index 279932486e58a6..950015b54ed8c8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs @@ -1614,6 +1614,7 @@ public static partial class ThreadPool #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif [CLSCompliant(false)] public static RegisteredWaitHandle RegisterWaitForSingleObject( @@ -1624,9 +1625,6 @@ public static RegisteredWaitHandle RegisterWaitForSingleObject( bool executeOnlyOnce // NOTE: we do not allow other options that allow the callback to be queued as an APC ) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif if (millisecondsTimeOutInterval > (uint)int.MaxValue && millisecondsTimeOutInterval != uint.MaxValue) throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_LessEqualToIntegerMaxVal); return RegisterWaitForSingleObject(waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce, true); @@ -1634,6 +1632,7 @@ public static RegisteredWaitHandle RegisterWaitForSingleObject( #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif [CLSCompliant(false)] public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( @@ -1644,9 +1643,6 @@ public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( bool executeOnlyOnce // NOTE: we do not allow other options that allow the callback to be queued as an APC ) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif if (millisecondsTimeOutInterval > (uint)int.MaxValue && millisecondsTimeOutInterval != uint.MaxValue) throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); return RegisterWaitForSingleObject(waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce, false); @@ -1654,6 +1650,7 @@ public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static RegisteredWaitHandle RegisterWaitForSingleObject( WaitHandle waitObject, @@ -1669,6 +1666,7 @@ public static RegisteredWaitHandle RegisterWaitForSingleObject( #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( WaitHandle waitObject, @@ -1678,15 +1676,13 @@ public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( bool executeOnlyOnce // NOTE: we do not allow other options that allow the callback to be queued as an APC ) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeOutInterval, -1); return RegisterWaitForSingleObject(waitObject, callBack, state, (uint)millisecondsTimeOutInterval, executeOnlyOnce, false); } #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static RegisteredWaitHandle RegisterWaitForSingleObject( WaitHandle waitObject, @@ -1696,9 +1692,6 @@ public static RegisteredWaitHandle RegisterWaitForSingleObject( bool executeOnlyOnce // NOTE: we do not allow other options that allow the callback to be queued as an APC ) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeOutInterval, -1); ArgumentOutOfRangeException.ThrowIfGreaterThan(millisecondsTimeOutInterval, int.MaxValue); return RegisterWaitForSingleObject(waitObject, callBack, state, (uint)millisecondsTimeOutInterval, executeOnlyOnce, true); @@ -1706,6 +1699,7 @@ public static RegisteredWaitHandle RegisterWaitForSingleObject( #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( WaitHandle waitObject, @@ -1715,9 +1709,6 @@ public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( bool executeOnlyOnce // NOTE: we do not allow other options that allow the callback to be queued as an APC ) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeOutInterval, -1); ArgumentOutOfRangeException.ThrowIfGreaterThan(millisecondsTimeOutInterval, int.MaxValue); return RegisterWaitForSingleObject(waitObject, callBack, state, (uint)millisecondsTimeOutInterval, executeOnlyOnce, false); @@ -1725,6 +1716,7 @@ public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static RegisteredWaitHandle RegisterWaitForSingleObject( WaitHandle waitObject, @@ -1734,9 +1726,6 @@ public static RegisteredWaitHandle RegisterWaitForSingleObject( bool executeOnlyOnce ) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif long tm = (long)timeout.TotalMilliseconds; ArgumentOutOfRangeException.ThrowIfLessThan(tm, -1, nameof(timeout)); @@ -1747,6 +1736,7 @@ bool executeOnlyOnce #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( WaitHandle waitObject, @@ -1756,9 +1746,6 @@ public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( bool executeOnlyOnce ) { -#if TARGET_WASI - if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 -#endif long tm = (long)timeout.TotalMilliseconds; ArgumentOutOfRangeException.ThrowIfLessThan(tm, -1, nameof(timeout)); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XmlUrlResolver.cs b/src/libraries/System.Private.Xml/src/System/Xml/XmlUrlResolver.cs index 453fd40abe3819..b738c254c3ce0e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XmlUrlResolver.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XmlUrlResolver.cs @@ -19,12 +19,14 @@ public partial class XmlUrlResolver : XmlResolver public XmlUrlResolver() { } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public override ICredentials? Credentials { set { _credentials = value; } } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public IWebProxy? Proxy { set { _proxy = value; } diff --git a/src/libraries/System.Runtime.Caching/Directory.Build.props b/src/libraries/System.Runtime.Caching/Directory.Build.props index 0232329ad312aa..d68d22c1b917f8 100644 --- a/src/libraries/System.Runtime.Caching/Directory.Build.props +++ b/src/libraries/System.Runtime.Caching/Directory.Build.props @@ -3,7 +3,5 @@ Microsoft true - - wasi \ No newline at end of file diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/CachingSectionGroup.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/CachingSectionGroup.cs index 2a72776e992089..207e71788431f7 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/CachingSectionGroup.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/CachingSectionGroup.cs @@ -9,6 +9,7 @@ namespace System.Runtime.Caching.Configuration { #if NET [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif internal sealed class CachingSectionGroup : ConfigurationSectionGroup { diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheElement.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheElement.cs index a72fc237c5f055..9d7431849d0322 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheElement.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheElement.cs @@ -10,6 +10,7 @@ namespace System.Runtime.Caching.Configuration { #if NET [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif internal sealed class MemoryCacheElement : ConfigurationElement { diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSection.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSection.cs index cd15eaa788b61e..3cbf72de4e94e6 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSection.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSection.cs @@ -23,6 +23,7 @@ namespace System.Runtime.Caching.Configuration #if NET [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif internal sealed class MemoryCacheSection : ConfigurationSection { diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSettingsCollection.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSettingsCollection.cs index 8088d208640d34..db1e50df7d7339 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSettingsCollection.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Configuration/MemoryCacheSettingsCollection.cs @@ -9,6 +9,7 @@ namespace System.Runtime.Caching.Configuration { #if NET [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif [ConfigurationCollection(typeof(MemoryCacheElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)] diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Counters.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Counters.cs index 8e8d65117bf950..2cf34720be8fbb 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Counters.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Counters.cs @@ -11,6 +11,7 @@ namespace System.Runtime.Caching { #if NET [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif internal sealed class Counters : EventSource { diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs index ee23f09a97e150..f0ac9d297cfe97 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs @@ -13,6 +13,7 @@ namespace System.Runtime.Caching { #if NET [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [SupportedOSPlatform("maccatalyst")] diff --git a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs index 4a29736a8652b8..d5555623b32448 100644 --- a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs +++ b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs @@ -334,6 +334,7 @@ public ComExposedClassAttribute() { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.CLSCompliantAttribute(false)] @@ -493,6 +494,7 @@ protected sealed override void ReleaseObjects(System.Collections.IEnumerable obj } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.CLSCompliantAttribute(false)] @@ -744,6 +746,7 @@ public ComSourceInterfacesAttribute(System.Type sourceInterface1, System.Type so } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.CLSCompliantAttribute(false)] @@ -1587,6 +1590,7 @@ public sealed partial class PosixSignalRegistration : System.IDisposable internal PosixSignalRegistration() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static System.Runtime.InteropServices.PosixSignalRegistration Create(System.Runtime.InteropServices.PosixSignal signal, System.Action handler) { throw null; } diff --git a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComInterfaceMarshaller.cs b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComInterfaceMarshaller.cs index 39f443673fcc71..b521be5a4d439e 100644 --- a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComInterfaceMarshaller.cs +++ b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComInterfaceMarshaller.cs @@ -15,6 +15,7 @@ namespace System.Runtime.InteropServices.Marshalling /// The managed type that represents a COM interface type [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [CLSCompliant(false)] diff --git a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/UniqueComInterfaceMarshaller.cs b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/UniqueComInterfaceMarshaller.cs index 59b965dd1d11f1..99cca7d27e8972 100644 --- a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/UniqueComInterfaceMarshaller.cs +++ b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/UniqueComInterfaceMarshaller.cs @@ -16,6 +16,7 @@ namespace System.Runtime.InteropServices.Marshalling /// The managed type that represents a COM interface type [UnsupportedOSPlatform("android")] [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [CLSCompliant(false)] diff --git a/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs b/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs index a272e40c33db39..db5115c1fb2801 100644 --- a/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs +++ b/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs @@ -45,6 +45,7 @@ namespace System.Runtime.Loader { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public sealed partial class AssemblyDependencyResolver diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index c043fb81ab51e3..73206fe3c49e63 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -2690,6 +2690,7 @@ public readonly struct ProcessCpuUsage [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")] [System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")] [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public static ProcessCpuUsage CpuUsage { get { throw null; } } public static string? ProcessPath { get { throw null; } } public static string StackTrace { get { throw null; } } @@ -15844,18 +15845,25 @@ public void Wait(System.Threading.CancellationToken cancellationToken) { } public bool Wait(System.TimeSpan timeout) { throw null; } public bool Wait(System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static void WaitAll(System.Collections.Generic.IEnumerable tasks, System.Threading.CancellationToken cancellationToken = default) { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static void WaitAll(params System.ReadOnlySpan tasks) { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static void WaitAll(params System.Threading.Tasks.Task[] tasks) { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static bool WaitAll(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static bool WaitAll(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static void WaitAll(System.Threading.Tasks.Task[] tasks, System.Threading.CancellationToken cancellationToken) { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static bool WaitAll(System.Threading.Tasks.Task[] tasks, System.TimeSpan timeout) { throw null; } public static int WaitAny(params System.Threading.Tasks.Task[] tasks) { throw null; } public static int WaitAny(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout) { throw null; } @@ -15894,6 +15902,7 @@ public static partial class TaskAsyncEnumerableExtensions public static System.Runtime.CompilerServices.ConfiguredAsyncDisposable ConfigureAwait(this System.IAsyncDisposable source, bool continueOnCapturedContext) { throw null; } public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable ConfigureAwait(this System.Collections.Generic.IAsyncEnumerable source, bool continueOnCapturedContext) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public static System.Collections.Generic.IEnumerable ToBlockingEnumerable(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable WithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken) { throw null; } } diff --git a/src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs b/src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs index 200fe545e56381..63d77ee067375b 100644 --- a/src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs +++ b/src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs @@ -92,10 +92,12 @@ public static void Sleep(int millisecondsTimeout) { } public static void Sleep(System.TimeSpan timeout) { } public static void SpinWait(int iterations) { } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public void Start() { } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public void Start(object? parameter) { } @@ -103,10 +105,12 @@ public void Start(object? parameter) { } public void Suspend() { } public bool TrySetApartmentState(System.Threading.ApartmentState state) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public void UnsafeStart() { } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public void UnsafeStart(object? parameter) { } diff --git a/src/libraries/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs b/src/libraries/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs index 5ff1eb3924e8e0..cff2f0323e7ce7 100644 --- a/src/libraries/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs +++ b/src/libraries/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs @@ -12,6 +12,7 @@ public partial interface IThreadPoolWorkItem } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public sealed partial class RegisteredWaitHandle : System.MarshalByRefObject { @@ -36,19 +37,23 @@ public static partial class ThreadPool public static bool QueueUserWorkItem(System.Action callBack, TState state, bool preferLocal) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static System.Threading.RegisteredWaitHandle RegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object? state, int millisecondsTimeOutInterval, bool executeOnlyOnce) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static System.Threading.RegisteredWaitHandle RegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object? state, long millisecondsTimeOutInterval, bool executeOnlyOnce) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static System.Threading.RegisteredWaitHandle RegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object? state, System.TimeSpan timeout, bool executeOnlyOnce) { throw null; } [System.CLSCompliantAttribute(false)] #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static System.Threading.RegisteredWaitHandle RegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object? state, uint millisecondsTimeOutInterval, bool executeOnlyOnce) { throw null; } public static bool SetMaxThreads(int workerThreads, int completionPortThreads) { throw null; } @@ -61,19 +66,23 @@ public static partial class ThreadPool public static bool UnsafeQueueUserWorkItem(System.Action callBack, TState state, bool preferLocal) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static System.Threading.RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object? state, int millisecondsTimeOutInterval, bool executeOnlyOnce) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static System.Threading.RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object? state, long millisecondsTimeOutInterval, bool executeOnlyOnce) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static System.Threading.RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object? state, System.TimeSpan timeout, bool executeOnlyOnce) { throw null; } [System.CLSCompliantAttribute(false)] #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static System.Threading.RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object? state, uint millisecondsTimeOutInterval, bool executeOnlyOnce) { throw null; } } diff --git a/src/libraries/System.Threading/ref/System.Threading.cs b/src/libraries/System.Threading/ref/System.Threading.cs index dca39d5c4719ec..7749753c2748aa 100644 --- a/src/libraries/System.Threading/ref/System.Threading.cs +++ b/src/libraries/System.Threading/ref/System.Threading.cs @@ -15,10 +15,12 @@ public Barrier(int participantCount, System.Action? po public int ParticipantCount { get { throw null; } } public int ParticipantsRemaining { get { throw null; } } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public long AddParticipant() { throw null; } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public long AddParticipants(int participantCount) { throw null; } @@ -27,26 +29,32 @@ protected virtual void Dispose(bool disposing) { } public void RemoveParticipant() { } public void RemoveParticipants(int participantCount) { } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public void SignalAndWait() { } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public bool SignalAndWait(int millisecondsTimeout) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public bool SignalAndWait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public void SignalAndWait(System.Threading.CancellationToken cancellationToken) { } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public bool SignalAndWait(System.TimeSpan timeout) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] #endif public bool SignalAndWait(System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken) { throw null; } @@ -80,26 +88,32 @@ public void Reset(int count) { } public bool TryAddCount(int signalCount) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public void Wait() { } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public bool Wait(int millisecondsTimeout) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public bool Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public void Wait(System.Threading.CancellationToken cancellationToken) { } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public bool Wait(System.TimeSpan timeout) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public bool Wait(System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -135,8 +149,10 @@ public ReaderWriterLock() { } public bool IsWriterLockHeld { get { throw null; } } public int WriterSeqNum { get { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public void AcquireReaderLock(int millisecondsTimeout) { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public void AcquireReaderLock(System.TimeSpan timeout) { } public void AcquireWriterLock(int millisecondsTimeout) { } public void AcquireWriterLock(System.TimeSpan timeout) { } @@ -146,10 +162,13 @@ public void DowngradeFromWriterLock(ref System.Threading.LockCookie lockCookie) public void ReleaseReaderLock() { } public void ReleaseWriterLock() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public void RestoreLock(ref System.Threading.LockCookie lockCookie) { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Threading.LockCookie UpgradeToWriterLock(int millisecondsTimeout) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public System.Threading.LockCookie UpgradeToWriterLock(System.TimeSpan timeout) { throw null; } } } @@ -355,26 +374,32 @@ public void Reset() { } public void Set() { } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public void Wait() { } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public bool Wait(int millisecondsTimeout) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public bool Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public void Wait(System.Threading.CancellationToken cancellationToken) { } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public bool Wait(System.TimeSpan timeout) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public bool Wait(System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -395,22 +420,27 @@ public static void TryEnter(object obj, int millisecondsTimeout, ref bool lockTa public static void TryEnter(object obj, System.TimeSpan timeout, ref bool lockTaken) { } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static bool Wait(object obj) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static bool Wait(object obj, int millisecondsTimeout) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static bool Wait(object obj, int millisecondsTimeout, bool exitContext) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static bool Wait(object obj, System.TimeSpan timeout) { throw null; } #if !FEATURE_WASM_MANAGED_THREADS [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] #endif public static bool Wait(object obj, System.TimeSpan timeout, bool exitContext) { throw null; } } @@ -485,16 +515,22 @@ protected virtual void Dispose(bool disposing) { } public int Release() { throw null; } public int Release(int releaseCount) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public void Wait() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public bool Wait(int millisecondsTimeout) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public bool Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public void Wait(System.Threading.CancellationToken cancellationToken) { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public bool Wait(System.TimeSpan timeout) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public bool Wait(System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken) { throw null; } public System.Threading.Tasks.Task WaitAsync() { throw null; } public System.Threading.Tasks.Task WaitAsync(int millisecondsTimeout) { throw null; } diff --git a/src/libraries/System.Threading/src/System/Threading/Barrier.cs b/src/libraries/System.Threading/src/System/Threading/Barrier.cs index e5cd44e77fe9fc..7815d825b73775 100644 --- a/src/libraries/System.Threading/src/System/Threading/Barrier.cs +++ b/src/libraries/System.Threading/src/System/Threading/Barrier.cs @@ -286,6 +286,7 @@ private bool SetCurrentTotal(int currentTotal, int current, int total, bool sens /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public long AddParticipant() { @@ -317,6 +318,7 @@ public long AddParticipant() /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public long AddParticipants(int participantCount) { @@ -477,6 +479,7 @@ public void RemoveParticipants(int participantCount) /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void SignalAndWait() { @@ -500,6 +503,7 @@ public void SignalAndWait() /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void SignalAndWait(CancellationToken cancellationToken) { @@ -532,6 +536,7 @@ public void SignalAndWait(CancellationToken cancellationToken) /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool SignalAndWait(TimeSpan timeout) { @@ -562,6 +567,7 @@ public bool SignalAndWait(TimeSpan timeout) /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool SignalAndWait(TimeSpan timeout, CancellationToken cancellationToken) { @@ -592,6 +598,7 @@ public bool SignalAndWait(TimeSpan timeout, CancellationToken cancellationToken) /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool SignalAndWait(int millisecondsTimeout) { @@ -621,6 +628,7 @@ public bool SignalAndWait(int millisecondsTimeout) /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool SignalAndWait(int millisecondsTimeout, CancellationToken cancellationToken) { @@ -863,6 +871,7 @@ private void WaitCurrentPhase(ManualResetEventSlim currentPhaseEvent, long obser /// True if the event is set or the phase number changed, false if the timeout expired #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif private bool DiscontinuousWait(ManualResetEventSlim currentPhaseEvent, int totalTimeout, CancellationToken token, long observedPhase) { diff --git a/src/libraries/System.Threading/src/System/Threading/CountdownEvent.cs b/src/libraries/System.Threading/src/System/Threading/CountdownEvent.cs index 837be45812ac31..e1744b975bb44f 100644 --- a/src/libraries/System.Threading/src/System/Threading/CountdownEvent.cs +++ b/src/libraries/System.Threading/src/System/Threading/CountdownEvent.cs @@ -405,6 +405,7 @@ public void Reset(int count) /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void Wait() { @@ -431,6 +432,7 @@ public void Wait() /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public void Wait(CancellationToken cancellationToken) { @@ -453,6 +455,7 @@ public void Wait(CancellationToken cancellationToken) /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool Wait(TimeSpan timeout) { @@ -484,6 +487,7 @@ public bool Wait(TimeSpan timeout) /// been canceled. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) { @@ -508,6 +512,7 @@ public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) /// disposed. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool Wait(int millisecondsTimeout) { @@ -533,6 +538,7 @@ public bool Wait(int millisecondsTimeout) /// been canceled. #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public bool Wait(int millisecondsTimeout, CancellationToken cancellationToken) { diff --git a/src/libraries/System.Threading/src/System/Threading/ReaderWriterLock.cs b/src/libraries/System.Threading/src/System/Threading/ReaderWriterLock.cs index 3248f45eb505e7..e9d6a37a348269 100644 --- a/src/libraries/System.Threading/src/System/Threading/ReaderWriterLock.cs +++ b/src/libraries/System.Threading/src/System/Threading/ReaderWriterLock.cs @@ -75,6 +75,7 @@ public bool AnyWritersSince(int seqNum) } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public void AcquireReaderLock(int millisecondsTimeout) { ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeout, -1); @@ -275,6 +276,7 @@ public void AcquireReaderLock(int millisecondsTimeout) } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public void AcquireReaderLock(TimeSpan timeout) => AcquireReaderLock(ToTimeoutMilliseconds(timeout)); public void AcquireWriterLock(int millisecondsTimeout) @@ -663,6 +665,7 @@ public void ReleaseWriterLock() } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public LockCookie UpgradeToWriterLock(int millisecondsTimeout) { ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeout, -1); @@ -740,6 +743,7 @@ public LockCookie UpgradeToWriterLock(int millisecondsTimeout) } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public LockCookie UpgradeToWriterLock(TimeSpan timeout) => UpgradeToWriterLock(ToTimeoutMilliseconds(timeout)); public void DowngradeFromWriterLock(ref LockCookie lockCookie) @@ -908,6 +912,7 @@ public LockCookie ReleaseLock() } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public void RestoreLock(ref LockCookie lockCookie) { // Validate cookie @@ -974,6 +979,7 @@ public void RestoreLock(ref LockCookie lockCookie) /// Helper function that restores the lock to the original state indicated by parameters /// [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] private void RecoverLock(ref LockCookie lockCookie, LockCookieFlags flags) { // Contrary to the legacy code, this method does not use a finite timeout for recovering the previous lock state, as diff --git a/src/libraries/System.Transactions.Local/ref/System.Transactions.Local.cs b/src/libraries/System.Transactions.Local/ref/System.Transactions.Local.cs index f3efc656f3c148..d3bd4c96e89900 100644 --- a/src/libraries/System.Transactions.Local/ref/System.Transactions.Local.cs +++ b/src/libraries/System.Transactions.Local/ref/System.Transactions.Local.cs @@ -9,6 +9,7 @@ namespace System.Transactions { [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed partial class CommittableTransaction : System.Transactions.Transaction, System.IAsyncResult { public CommittableTransaction() { } @@ -234,6 +235,7 @@ public TransactionPromotionException(string? message) { } public TransactionPromotionException(string? message, System.Exception? innerException) { } } [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed partial class TransactionScope : System.IDisposable { public TransactionScope() { } diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs index dfeace8bd4a531..b78855fcf75399 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs @@ -10,6 +10,7 @@ namespace System.Transactions { [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public sealed class CommittableTransaction : Transaction, IAsyncResult { // Create a transaction with defaults diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionScope.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionScope.cs index 71edfdf6103259..ffe774c9de52df 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionScope.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionScope.cs @@ -34,6 +34,7 @@ public enum EnterpriseServicesInteropOption } [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] public sealed class TransactionScope : IDisposable { public TransactionScope() : this(TransactionScopeOption.Required) diff --git a/src/libraries/System.Xml.ReaderWriter/ref/System.Xml.ReaderWriter.cs b/src/libraries/System.Xml.ReaderWriter/ref/System.Xml.ReaderWriter.cs index c2fd2923baebca..96834d32e548a9 100644 --- a/src/libraries/System.Xml.ReaderWriter/ref/System.Xml.ReaderWriter.cs +++ b/src/libraries/System.Xml.ReaderWriter/ref/System.Xml.ReaderWriter.cs @@ -1148,8 +1148,10 @@ public partial class XmlUrlResolver : System.Xml.XmlResolver public XmlUrlResolver() { } public System.Net.Cache.RequestCachePolicy CachePolicy { set { } } [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public override System.Net.ICredentials? Credentials { set { } } [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public System.Net.IWebProxy? Proxy { set { } } public override object? GetEntity(System.Uri absoluteUri, string? role, System.Type? ofObjectToReturn) { throw null; } public override System.Threading.Tasks.Task GetEntityAsync(System.Uri absoluteUri, string? role, System.Type? ofObjectToReturn) { throw null; } diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs index 4633be109690a1..564acabcc5e5ed 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs @@ -73,6 +73,7 @@ public static bool IsEntered(object obj) #if !FEATURE_WASM_MANAGED_THREADS [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("wasi")] #endif public static bool Wait(object obj, int millisecondsTimeout) { diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs index dbfe5c87957fbb..060c7929f55d9f 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs @@ -15,6 +15,7 @@ namespace System.Threading #error when compiled with FEATURE_WASM_MANAGED_THREADS, we use PortableThreadPool.WorkerThread.Browser.Threads.Mono.cs #endif [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed class RegisteredWaitHandle : MarshalByRefObject { internal RegisteredWaitHandle() diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.Mono.cs index bad9fbdbaaddf5..c5737f26c01184 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.Mono.cs @@ -15,6 +15,7 @@ namespace System.Threading #error when compiled with FEATURE_WASM_MANAGED_THREADS #endif [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed class RegisteredWaitHandle : MarshalByRefObject { internal RegisteredWaitHandle()