Boolean-backed enum type support removed
Support for formatting, parsing, and conversions of Boolean-backed enumeration types has been removed.
Previous behavior
Previously, formatting, parsing, or converting a Boolean-backed enumeration type was somewhat functional.
New behavior
Starting in .NET 8, an InvalidOperationException is thrown if you try to format, parse, or convert a Boolean-backed enumeration type.
Version introduced
.NET 8 Preview 1
Type of breaking change
This change is a behavioral change.
Reason for change
This change was made to make the .NET runtime simpler, faster, and smaller. Formatting and parsing Boolean-backed enumeration types is never used in practice and complicates the implementation. Also, Boolean-backed enum types aren't expressible in C#.
Recommended action
If you're using a Boolean-backed enumeration type, use a regular Boolean type or a byte-backed enumeration type instead.
Affected APIs
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho