Selected TableLayoutSettings properties throw InvalidEnumArgumentException
Selected TableLayoutSettings properties now throw an InvalidEnumArgumentException if you attempt to assign an incorrect value.
Change description
In previous .NET versions, these properties throw an ArgumentOutOfRangeException if you attempt to assign an incorrect value. Starting in .NET 6, these properties throw an InvalidEnumArgumentException in such cases.
Change category
This change affects binary compatibility.
Reason for change
Throwing InvalidEnumArgumentException is in line with the existing Windows Forms API in similar situations. Throwing this exception also provides developers with a better debug experience.
Version introduced
.NET 6
Recommended action
- Update the code to prevent assigning incorrect values.
- If necessary, handle an InvalidEnumArgumentException when accessing these APIs.
Affected APIs
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.