Skip to content

Commit a40c7cd

Browse files
authored
Add AE breaking change (#18049)
* add one method
1 parent d2a4077 commit a40c7cd

File tree

4 files changed

+53
-3
lines changed

4 files changed

+53
-3
lines changed

docs/core/compatibility/3.1-5.0.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ If you're migrating from version 3.1 of .NET Core, ASP.NET Core, or EF Core to v
4141
## Windows Forms
4242

4343
- [Removed status bar controls](#removed-status-bar-controls)
44-
- [WinForms APIs now throw ArgumentNullException](#winforms-apis-now-throw-argumentnullexception)
44+
- [WinForms methods now throw ArgumentException](#winforms-methods-now-throw-argumentexception)
45+
- [WinForms methods now throw ArgumentNullException](#winforms-methods-now-throw-argumentnullexception)
4546

4647
[!INCLUDE [winforms-deprecated-controls](../../../includes/core-changes/windowsforms/5.0/winforms-deprecated-controls.md)]
4748

4849
***
4950

51+
[!INCLUDE [invalid-args-cause-argumentexception](../../../includes/core-changes/windowsforms/5.0/invalid-args-cause-argumentexception.md)]
52+
53+
***
54+
5055
[!INCLUDE [null-args-cause-argumentnullexception](../../../includes/core-changes/windowsforms/5.0/null-args-cause-argumentnullexception.md)]
5156

5257
***

docs/core/compatibility/winforms.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ The following breaking changes are documented on this page:
1212
| Breaking change | Version introduced |
1313
| - | :-: |
1414
| [Removed status bar controls](#removed-status-bar-controls) | 5.0 |
15-
| [WinForms APIs now throw ArgumentNullException](#winforms-apis-now-throw-argumentnullexception) | 5.0 |
15+
| [WinForms methods now throw ArgumentException](#winforms-methods-now-throw-argumentexception) | 5.0 |
16+
| [WinForms methods now throw ArgumentNullException](#winforms-methods-now-throw-argumentnullexception) | 5.0 |
1617
| [Removed controls](#removed-controls) | 3.1 |
1718
| [CellFormatting event not raised if tooltip is shown](#cellformatting-event-not-raised-if-tooltip-is-shown) | 3.1 |
1819
| [Control.DefaultFont changed to Segoe UI 9 pt](#default-control-font-changed-to-segoe-ui-9-pt) | 3.0 |
@@ -35,6 +36,10 @@ The following breaking changes are documented on this page:
3536

3637
***
3738

39+
[!INCLUDE [invalid-args-cause-argumentexception](../../../includes/core-changes/windowsforms/5.0/invalid-args-cause-argumentexception.md)]
40+
41+
***
42+
3843
[!INCLUDE [null-args-cause-argumentnullexception](../../../includes/core-changes/windowsforms/5.0/null-args-cause-argumentnullexception.md)]
3944

4045
***
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
### WinForms methods now throw ArgumentException
2+
3+
Some Windows Forms methods now throw an <xref:System.ArgumentException> for invalid arguments, where previously they did not.
4+
5+
#### Change description
6+
7+
Previously, passing arguments of an unexpected or incorrect type to certain Windows Forms methods would result in an indeterminate state. Starting in .NET 5.0, these methods now throw an <xref:System.ArgumentException> when passed invalid arguments.
8+
9+
Throwing an <xref:System.ArgumentException> conforms to the behavior of the .NET runtime. It also improves the debugging experience by clearly communicating which argument is invalid.
10+
11+
The following table lists the affected methods and parameters:
12+
13+
| Method | Parameter name | Condition | Version added |
14+
|-|-|-|
15+
| <xref:System.Windows.Forms.TabControl.GetToolTipText(System.Object)?displayProperty=fullName> | `item` | Argument is not of type <xref:System.Windows.Forms.TabPage>. | 5.0 Preview 1 |
16+
17+
#### Version introduced
18+
19+
.NET 5.0 Preview 1
20+
21+
#### Recommended action
22+
23+
- Update the code to prevent passing invalid arguments.
24+
- If necessary, handle an <xref:System.ArgumentException> when calling the method.
25+
26+
#### Category
27+
28+
Windows Forms
29+
30+
#### Affected APIs
31+
32+
- <xref:System.Windows.Forms.TabControl.GetToolTipText(System.Object)?displayProperty=fullName>
33+
34+
<!--
35+
36+
### Affected APIs
37+
38+
- `M:System.Windows.Forms.TabControl.GetToolTipText(System.Object)`
39+
40+
-->

includes/core-changes/windowsforms/5.0/null-args-cause-argumentnullexception.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### WinForms APIs now throw ArgumentNullException
1+
### WinForms methods now throw ArgumentNullException
22

33
Some Windows Forms methods now throw an <xref:System.ArgumentNullException> for null arguments, where previously they threw a <xref:System.NullReferenceException>.
44

0 commit comments

Comments
 (0)