Skip to content

Commit

Permalink
WASM: Add PlatformNotSupportedException for System.IO.Pipes (#39089)
Browse files Browse the repository at this point in the history
* WASM: Add PlatformNotSupportedException for System.IO.Pipes

The library isn't supported on WebAssembly.

* Make test TFMs match src TFMs
  • Loading branch information
akoeplinger authored Jul 10, 2020
1 parent 685314f commit a0987db
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/libraries/System.IO.Pipes/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,7 @@
<data name="NotSupported_PipeSecurityIsCurrentUserOnly" xml:space="preserve">
<value>'pipeSecurity' must be null when 'options' contains 'PipeOptions.CurrentUserOnly'. </value>
</data>
<data name="Pipes_PlatformNotSupported" xml:space="preserve">
<value>System.IO.Pipes is not supported on this platform</value>
</data>
</root>
9 changes: 6 additions & 3 deletions src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
<AssemblyName>System.IO.Pipes</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OmitTransitiveCompileReferences>true</OmitTransitiveCompileReferences>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsAnyOS)' == 'true'">SR.Pipes_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<!-- Compiled Source Files -->
<ItemGroup>
<ItemGroup Condition="'$(TargetsAnyOS)' != 'true'">
<Compile Include="Microsoft\Win32\SafeHandles\SafePipeHandle.cs" />
<Compile Include="System\IO\Error.cs" />
<Compile Include="System\IO\Pipes\AnonymousPipeClientStream.cs" />
Expand Down Expand Up @@ -115,7 +118,7 @@
Link="Common\Interop\Windows\Interop.LoadLibraryEx_IntPtr.cs" />
<Compile Include="System\IO\Pipes\NamedPipeServerStream.Win32.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true' ">
<ItemGroup Condition=" '$(TargetsUnix)' == 'true'">
<Compile Include="Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs" />
<Compile Include="System\IO\Pipes\AnonymousPipeServerStream.Unix.cs" />
<Compile Include="System\IO\Pipes\NamedPipeClientStream.Unix.cs" />
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.IO.Pipes/tests/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
using Xunit;

[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
[assembly: SkipOnMono("System.IO.Pipes is not supported on Browser", TestPlatforms.Browser)]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)</TargetFrameworks>
<IgnoreForCI Condition="'$(TargetOS)' == 'Browser'">true</IgnoreForCI>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
Expand Down

0 comments on commit a0987db

Please sign in to comment.