Since FileSystemWatcher is not supported on wasm, throw PNSE and skip tests (#38368)

Co-authored-by: Steve Pfister <[email protected]>
This commit is contained in:
Steve PfisterandSteve Pfister authored and GitHub committed 2020-06-25 13:59:09 +02:00
1 parent cd4c4c99ba
commit 3b95bca292
4 files changed
+17 -2

No files matched your search

@@ -191,4 +191,7 @@
<data name="IO_PathTooLong_Path" xml:space="preserve">
<value>The path '{0}' is too long, or a component of the specified path is too long.</value>
</data>
<data name="FileSystemWatcher_PlatformNotSupported" xml:space="preserve">
<value>System.IO.FileSystem.Watcher is not supported on Browser.</value>
</data>
</root>
@@ -1,10 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsBrowser)' == 'true'">SR.FileSystemWatcher_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<Compile Include="System\HResults.cs" />
<Compile Include="System\IO\ErrorEventArgs.cs" />
<Compile Include="System\IO\ErrorEventHandler.cs" />
@@ -0,0 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Xunit;
[assembly: SkipOnMono("System.IO.FileSystem.Watcher is not supported on wasm", TestPlatforms.Browser)]
@@ -4,6 +4,7 @@
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="FileSystemWatcher.cs" />
<Compile Include="InternalBufferOverflowException.cs" />
<Compile Include="Args.ErrorEventArgs.cs" />