Skip to content

Commit

Permalink
Fix .NET 5 FileStream compat detection in the test utility project (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsitnik authored Aug 12, 2021
1 parent 21e340d commit cbc1f6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private static Version GetICUVersion()
version & 0xFF);
}

private static readonly Lazy<bool> _net5CompatFileStream = new Lazy<bool>(() => GetStaticNonPublicBooleanPropertyValue("System.IO.FileStreamHelpers", "UseNet5CompatStrategy"));
private static readonly Lazy<bool> _net5CompatFileStream = new Lazy<bool>(() => GetStaticNonPublicBooleanPropertyValue("System.IO.Strategies.FileStreamHelpers", "UseNet5CompatStrategy"));

public static bool IsNet5CompatFileStreamEnabled => _net5CompatFileStream.Value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class Net5CompatSwitchTests
[Fact]
public static void LegacySwitchIsHonored()
{
Assert.True(PlatformDetection.IsNet5CompatFileStreamEnabled);

string filePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName());

using (FileStream fileStream = File.Create(filePath))
Expand Down

0 comments on commit cbc1f6a

Please sign in to comment.