Skip to content

[Breaking change]: Remove Net5CompatFileStreamStrategy. #31465

Closed
@jozkee

Description

@jozkee

Description

The ability to switch to use the legacy FileStream implementation and the Net5CompatFileStreamStrategy switch was removed.

Version: .NET 7 preview 1.

Version

Other (please put exact version in description textbox)

Previous behavior

Legacy FileStream implementation was available and you could opt-in to use it with Net5CompatFileStreamStrategy.

New behavior

You can no longer opt-in to use legacy FileStream implementation.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.

Reason for change

Net5CompatFileStreamStrategy was included in .NET 6 in case the new implementation could have caused breaking changes, which it did, and those were already fixed. Since there are no more bugs introduced by the FileStream changes, the compatibility mode was removed and with it all the legacy code, which makes our codebase easier to maintain.

Recommended action

Devs finding themselves using .NET 6 and opting-into the legacy code through Net5CompatFileStreamStrategy should be adviced that the switch no longer has an effect on .NET 7 and that they can remove it.

Feature area

Core .NET libraries

Affected APIs

System.IO.FileStream plus all the acceleration APIs using it e.g:
System.IO.File.Create(String, Int32, FileOptions)
System.IO.File.Create(String)
System.IO.File.Create(String, Int32)
System.IO.File.Open(String, FileMode)
System.IO.File.Open(String, FileStreamOptions)
System.IO.File.Open(String, FileMode, FileAccess)
System.IO.File.Open(String, FileMode, FileAccess, FileShare)
etc.

Let me know if you need a complete list of affected APIs.

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 7Work items for the .NET 7 releasebreaking-changeIndicates a .NET Core breaking change

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions