-
Notifications
You must be signed in to change notification settings - Fork 5.3k
74642 change isostorage path #75541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
74642 change isostorage path #75541
Changes from 5 commits
9034496
9878272
b5fd07f
5732db6
254242f
b828032
37140e3
ff6cadb
3bf593a
d5b2414
4f2e3fd
0f8c243
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace System.IO.IsolatedStorage | ||
| { | ||
| public sealed partial class IsolatedStorageFile : IsolatedStorage, IDisposable | ||
| { | ||
| private string GetIsolatedStorageRoot() | ||
| { | ||
| return Helper.GetRootDirectory(Scope); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is done in https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.Win32Unix.cs#L26 ,https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.cs#L8
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But the latest change will change the behavior of all platforms, not just the mobile ones, right? I'm not sure if that's something we can/should do, because it could lead to the same problem just on different platforms.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not in all cases config is appended |
||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Text; | ||
|
|
||
| namespace System.IO.IsolatedStorage | ||
| { | ||
| public sealed partial class IsolatedStorageFile : IsolatedStorage, IDisposable | ||
| { | ||
| private string GetIsolatedStorageRoot() | ||
| { | ||
| StringBuilder root = new StringBuilder(Helper.GetRootDirectory(Scope)); | ||
| root.Append(SeparatorExternal); | ||
| root.Append(IdentityHash); | ||
mkhamoyan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return root.ToString(); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Reflection; | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace System.IO.IsolatedStorage | ||
| { | ||
| public static partial class TestHelper | ||
| { | ||
| private static List<string> GetRoots() | ||
| { | ||
| List<string> roots = new List<string>(); | ||
| string userRoot = Helper.GetDataDirectory(IsolatedStorageScope.User); | ||
| string randomUserRoot = Helper.GetRandomDirectory(userRoot, IsolatedStorageScope.User); | ||
| roots.Add(randomUserRoot); | ||
|
|
||
| // Application scope doesn't go under a random dir | ||
| roots.Add(userRoot); | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Reflection; | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace System.IO.IsolatedStorage | ||
| { | ||
| public static partial class TestHelper | ||
| { | ||
| private static List<string> GetRoots() | ||
| { | ||
| string hash; | ||
| object identity; | ||
| Helper.GetDefaultIdentityAndHash(out identity, out hash, '.'); | ||
| List<string> roots = new List<string>(); | ||
| string userRoot = Helper.GetDataDirectory(IsolatedStorageScope.User); | ||
| string randomUserRoot = Helper.GetRandomDirectory(userRoot, IsolatedStorageScope.User); | ||
|
|
||
| roots.Add(Path.Combine(randomUserRoot, hash)); | ||
| // Application scope doesn't go under a random dir | ||
| roots.Add(Path.Combine(userRoot, hash)); | ||
|
|
||
| // https://github.com/dotnet/runtime/issues/2092 | ||
| // https://github.com/dotnet/runtime/issues/21742 | ||
| if (OperatingSystem.IsWindows() | ||
| && !PlatformDetection.IsInAppContainer) | ||
| { | ||
| roots.Add(Helper.GetDataDirectory(IsolatedStorageScope.Machine)); | ||
| } | ||
|
|
||
| return roots; | ||
| } | ||
| } | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
|
|
||
| namespace System.IO.IsolatedStorage | ||
| { | ||
| public static class TestHelper | ||
| public static partial class TestHelper | ||
| { | ||
| private static PropertyInfo s_rootDirectoryProperty; | ||
| private static List<string> s_roots; | ||
|
|
@@ -17,27 +17,8 @@ static TestHelper() | |
| { | ||
| s_rootDirectoryProperty = typeof(IsolatedStorageFile).GetProperty("RootDirectory", BindingFlags.NonPublic | BindingFlags.Instance); | ||
|
|
||
| s_roots = new List<string>(); | ||
|
|
||
| string hash; | ||
| object identity; | ||
| Helper.GetDefaultIdentityAndHash(out identity, out hash, '.'); | ||
|
|
||
| string userRoot = Helper.GetDataDirectory(IsolatedStorageScope.User); | ||
| string randomUserRoot = Helper.GetRandomDirectory(userRoot, IsolatedStorageScope.User); | ||
| s_roots.Add(Path.Combine(randomUserRoot, hash)); | ||
|
|
||
| // Application scope doesn't go under a random dir | ||
| s_roots.Add(Path.Combine(userRoot, hash)); | ||
|
|
||
| // https://github.com/dotnet/runtime/issues/2092 | ||
| // https://github.com/dotnet/runtime/issues/21742 | ||
| if (OperatingSystem.IsWindows() | ||
| && !PlatformDetection.IsInAppContainer) | ||
| { | ||
| s_roots.Add(Helper.GetDataDirectory(IsolatedStorageScope.Machine)); | ||
| } | ||
|
|
||
| s_roots = GetRoots(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What tests are failing if this isn't changed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As roots are different for mobile and non mobile platforms I needed to implement differently for them. |
||
|
|
||
| // We don't expose Roaming yet | ||
| // Helper.GetDataDirectory(IsolatedStorageScope.Roaming); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.