Skip to content

Commit a5348dc

Browse files
committed
make it compile
1 parent 9cadae3 commit a5348dc

File tree

20 files changed

+26
-25
lines changed

20 files changed

+26
-25
lines changed

src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ internal PhysicalFilesWatcher CreateFileWatcher()
164164
FileSystemWatcher? watcher;
165165
#if NET
166166
// For browser/iOS/tvOS we will proactively fallback to polling since FileSystemWatcher is not supported.
167-
if (OperatingSystem.IsBrowser() || (OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS())
167+
if (OperatingSystem.IsBrowser() || OperatingSystem.IsWasi() || (OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS())
168168
{
169169
UsePollingFileWatcher = true;
170170
UseActivePolling = true;

src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public PhysicalFilesWatcher(
8989
if (fileSystemWatcher != null)
9090
{
9191
#if NET
92-
if (OperatingSystem.IsBrowser() || (OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS())
92+
if (OperatingSystem.IsBrowser() || OperatingSystem.IsWasi() || (OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS())
9393
{
9494
throw new PlatformNotSupportedException(SR.Format(SR.FileSystemWatcher_PlatformNotSupported, typeof(FileSystemWatcher)));
9595
}

src/libraries/Microsoft.Extensions.Hosting/src/HostBuilder.netcoreapp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public partial class HostBuilder
1111
{
1212
private static void AddLifetime(IServiceCollection services)
1313
{
14-
if (!OperatingSystem.IsAndroid() && !OperatingSystem.IsBrowser() && !OperatingSystem.IsIOS() && !OperatingSystem.IsTvOS())
14+
if (!OperatingSystem.IsAndroid() && !OperatingSystem.IsBrowser() && !OperatingSystem.IsWasi() && !OperatingSystem.IsIOS() && !OperatingSystem.IsTvOS())
1515
{
1616
services.AddSingleton<IHostLifetime, ConsoleLifetime>();
1717
}

src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ internal static void AddDefaultServices(HostBuilderContext hostingContext, IServ
293293

294294
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
295295
#if NET
296-
if (!OperatingSystem.IsBrowser())
296+
if (!OperatingSystem.IsBrowser() && !OperatingSystem.IsWasi())
297297
#endif
298298
{
299299
logging.AddConsole();

src/libraries/System.Configuration.ConfigurationManager/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
44
<IncludePlatformAttributes>true</IncludePlatformAttributes>
5-
<UnsupportedOSPlatforms>browser</UnsupportedOSPlatforms>
5+
<UnsupportedOSPlatforms>browser;wasi</UnsupportedOSPlatforms>
66
</PropertyGroup>
77
</Project>

src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public void OnEventCommand(EventCommandEventArgs command)
319319
try
320320
{
321321
#if OS_ISBROWSER_SUPPORT
322-
if (OperatingSystem.IsBrowser())
322+
if (OperatingSystem.IsBrowser() || OperatingSystem.IsWasi())
323323
{
324324
// AggregationManager uses a dedicated thread to avoid losing data for apps experiencing threadpool starvation
325325
// and browser doesn't support Thread.Start()

src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static RuntimeMetrics()
146146
unit: "{cpu}",
147147
description: "The number of processors available to the process.");
148148

149-
if (!OperatingSystem.IsBrowser() && !OperatingSystem.IsTvOS() && !(OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()))
149+
if (!OperatingSystem.IsBrowser() && !OperatingSystem.IsWasi() && !OperatingSystem.IsTvOS() && !(OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()))
150150
{
151151
s_meter.CreateObservableCounter(
152152
"dotnet.process.cpu.time",

src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public static class ParallelEnumerable
6666
// be executed in parallel, but will retain PLINQ semantics (exceptions wrapped as aggregates, etc).
6767
#if !FEATURE_WASM_MANAGED_THREADS
6868
[System.Runtime.Versioning.SupportedOSPlatformGuard("browser")]
69-
internal static bool SinglePartitionMode => OperatingSystem.IsBrowser();
7069
[System.Runtime.Versioning.SupportedOSPlatformGuard("wasi")]
70+
internal static bool SinglePartitionMode => OperatingSystem.IsBrowser() || OperatingSystem.IsWasi();
7171
#else
7272
internal static bool SinglePartitionMode => false;
7373
#endif

src/libraries/System.Net.Http/src/System.Net.Http.csproj

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
</ItemGroup>
167167

168168
<!-- SocketsHttpHandler implementation -->
169-
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'browser'">
169+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'browser' and '$(TargetPlatformIdentifier)' != 'wasi'">
170170
<Compile Include="System\Net\Http\HttpHandlerDefaults.cs" />
171171
<Compile Include="System\Net\Http\HttpMethod.SocketsHttpHandler.cs" />
172172
<Compile Include="System\Net\Http\Headers\AltSvcHeaderParser.cs" />
@@ -324,13 +324,13 @@
324324
</ItemGroup>
325325

326326
<!-- SocketsHttpHandler platform parts -->
327-
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'browser'">
327+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'browser' and '$(TargetPlatformIdentifier)' != 'wasi'">
328328
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs" />
329329
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.Unix.cs" />
330330
<Compile Include="System\Net\Http\SocketsHttpHandler\CurrentUserIdentityProvider.Unix.cs" />
331331
</ItemGroup>
332332

333-
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'browser' and '$(TargetPlatformIdentifier)' != 'osx' and '$(TargetPlatformIdentifier)' != 'ios' and '$(TargetPlatformIdentifier)' != 'tvos' and '$(TargetPlatformIdentifier)' != 'maccatalyst'">
333+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'browser' and '$(TargetPlatformIdentifier)' != 'wasi' and '$(TargetPlatformIdentifier)' != 'osx' and '$(TargetPlatformIdentifier)' != 'ios' and '$(TargetPlatformIdentifier)' != 'tvos' and '$(TargetPlatformIdentifier)' != 'maccatalyst'">
334334
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
335335
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.Unix.cs" />
336336
</ItemGroup>
@@ -407,7 +407,7 @@
407407
Link="Common\System\Runtime\ExceptionServices\ExceptionStackTrace.cs" />
408408
</ItemGroup>
409409

410-
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'browser'">
410+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'browser' and '$(TargetPlatformIdentifier)' != 'wasi'">
411411
<Compile Include="$(CommonPath)System\StrongToWeakReference.cs"
412412
Link="Common\Interop\Unix\StrongToWeakReference.cs" />
413413
<Compile Include="$(CommonPath)System\Net\SecurityProtocol.cs"
@@ -432,26 +432,29 @@
432432
Link="Common\System\Net\Security\CertificateHelper.Unix.cs" />
433433
</ItemGroup>
434434

435-
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'browser' and '$(TargetPlatformIdentifier)' != 'osx' and '$(TargetPlatformIdentifier)' != 'ios' and '$(TargetPlatformIdentifier)' != 'tvos'">
435+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'browser' and '$(TargetPlatformIdentifier)' != 'wasi' and '$(TargetPlatformIdentifier)' != 'osx' and '$(TargetPlatformIdentifier)' != 'ios' and '$(TargetPlatformIdentifier)' != 'tvos'">
436436
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs"
437437
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs" />
438438
</ItemGroup>
439439

440-
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'browser'">
440+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'browser' or '$(TargetPlatformIdentifier)' == 'wasi'">
441441
<Compile Include="$(CommonPath)\System\Net\HttpStatusDescription.cs"
442442
Link="Common\System\Net\HttpStatusDescription.cs" />
443443
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpKeepAlivePingPolicy.cs" />
444444
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
445445
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpConnectionContext.cs" />
446-
<Compile Include="System\Net\Http\BrowserHttpHandler\SystemProxyInfo.Browser.cs" />
446+
<Compile Include="System\Net\Http\BrowserHttpHandler\SystemProxyInfo.Wasm.cs" />
447447
<Compile Include="System\Net\Http\BrowserHttpHandler\SocketsHttpHandler.cs" />
448-
<Compile Include="System\Net\Http\BrowserHttpHandler\BrowserHttpHandler.cs" />
449448
<Compile Include="System\Net\Http\BrowserHttpHandler\HttpTelemetry.Browser.cs" />
450-
<Compile Include="System\Net\Http\BrowserHttpHandler\BrowserHttpInterop.cs" />
451449
<Compile Include="$(CommonPath)System\Net\Http\HttpHandlerDefaults.cs"
452450
Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
453451
</ItemGroup>
454452

453+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'browser'">
454+
<Compile Include="System\Net\Http\BrowserHttpHandler\BrowserHttpHandler.cs" />
455+
<Compile Include="System\Net\Http\BrowserHttpHandler\BrowserHttpInterop.cs" />
456+
</ItemGroup>
457+
455458
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'wasi'">
456459
<Reference Include="System.Threading.Thread" />
457460
<Compile Include="System\Net\Http\WasiHttpHandler\WasiHttpHandler.cs" />

0 commit comments

Comments
 (0)