Skip to content
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

Disable Net5CompatFileStream by default #50166

Merged
merged 8 commits into from
Apr 8, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void LegacySwitchIsHonored()
.GetField("_strategy", BindingFlags.NonPublic | BindingFlags.Instance)
.GetValue(fileStream);

Assert.DoesNotContain(strategy.GetType().FullName, "Legacy");
Assert.Contains("Legacy", strategy.GetType().FullName);
}

File.Delete(filePath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"configProperties": {
"System.IO.UseNet5CompatFileStream": false
"System.IO.UseNet5CompatFileStream": true
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"configProperties": {
"System.IO.UseNet5CompatFileStream": false
"System.IO.UseNet5CompatFileStream": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private static bool GetLegacyFileStreamSetting()

string? envVar = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_IO_USENET5COMPATFILESTREAM");
return envVar is null
? true // legacy is currently enabled by default;
? false // legacy is disabled by default;
: bool.IsTrueStringIgnoreCase(envVar) || envVar.Equals("1");
adamsitnik marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down