Skip to content

Commit ce65dfa

Browse files
authored
[Wasm] Modify System.IO.IsolatedStorage to throw PNSE (#38898)
1 parent 2b7a301 commit ce65dfa

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/libraries/System.IO.IsolatedStorage/src/Resources/Strings.resx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,8 @@
140140
</data>
141141
<data name="PlatformNotSupported_CAS" xml:space="preserve">
142142
<value>Code Access Security is not supported on this platform.</value>
143-
</data>
143+
</data>
144+
<data name="IsolatedStorage_PlatformNotSupported" xml:space="preserve">
145+
<value>System.IO.IsolatedStorage is not supported on this platform.</value>
146+
</data>
144147
</root>

src/libraries/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
3+
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)</TargetFrameworks>
44
<Nullable>enable</Nullable>
55
</PropertyGroup>
6-
<ItemGroup>
6+
<PropertyGroup>
7+
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsAnyOS)' == 'true'">SR.IsolatedStorage_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
8+
</PropertyGroup>
9+
<ItemGroup Condition="'$(TargetsAnyOS)' != 'true'">
710
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageException.cs" />
811
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageFile.cs" />
912
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageFileStream.cs" />
@@ -18,18 +21,20 @@
1821
<ItemGroup Condition="'$(TargetsWindows)' == 'true'">
1922
<Compile Include="System\IO\IsolatedStorage\Helper.Win32.cs" />
2023
</ItemGroup>
21-
<ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'">
24+
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
2225
<Compile Include="System\IO\IsolatedStorage\Helper.Unix.cs" />
2326
</ItemGroup>
24-
<ItemGroup>
27+
<ItemGroup Condition="'$(TargetsAnyOS)' != 'true'">
2528
<Reference Include="System.IO.FileSystem" />
2629
<Reference Include="System.Linq" />
27-
<Reference Include="System.Runtime" />
2830
<Reference Include="System.Runtime.Extensions" />
2931
<Reference Include="System.Security.Cryptography.Algorithms" />
3032
<Reference Include="System.Security.Cryptography.Primitives" />
3133
<Reference Include="System.Threading" />
3234
</ItemGroup>
35+
<ItemGroup>
36+
<Reference Include="System.Runtime" />
37+
</ItemGroup>
3338
<ItemGroup Condition="'$(TargetsWindows)' == 'true'">
3439
<Reference Include="System.IO.FileSystem.AccessControl" />
3540
<Reference Include="System.Security.AccessControl" />

src/libraries/System.IO.IsolatedStorage/tests/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
// create unique identities for every test to allow every test to have
99
// it's own store.
1010
[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true)]
11+
[assembly: SkipOnMono("System.IO.IsolatedStorage is not supported on Browser", TestPlatforms.Browser)]

0 commit comments

Comments
 (0)