Skip to content

Add AE breaking change #18049

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

Merged
merged 3 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/core/compatibility/3.1-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ If you're migrating from version 3.1 of .NET Core, ASP.NET Core, or EF Core to v
## Windows Forms

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

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

***

[!INCLUDE [invalid-args-cause-argumentexception](../../../includes/core-changes/windowsforms/5.0/invalid-args-cause-argumentexception.md)]

***

[!INCLUDE [null-args-cause-argumentnullexception](../../../includes/core-changes/windowsforms/5.0/null-args-cause-argumentnullexception.md)]

***
7 changes: 6 additions & 1 deletion docs/core/compatibility/winforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ The following breaking changes are documented on this page:
| Breaking change | Version introduced |
| - | :-: |
| [Removed status bar controls](#removed-status-bar-controls) | 5.0 |
| [WinForms APIs now throw ArgumentNullException](#winforms-apis-now-throw-argumentnullexception) | 5.0 |
| [WinForms methods now throw ArgumentException](#winforms-methods-now-throw-argumentexception) | 5.0 |
| [WinForms methods now throw ArgumentNullException](#winforms-methods-now-throw-argumentnullexception) | 5.0 |
| [Removed controls](#removed-controls) | 3.1 |
| [CellFormatting event not raised if tooltip is shown](#cellformatting-event-not-raised-if-tooltip-is-shown) | 3.1 |
| [Control.DefaultFont changed to Segoe UI 9 pt](#default-control-font-changed-to-segoe-ui-9-pt) | 3.0 |
Expand All @@ -35,6 +36,10 @@ The following breaking changes are documented on this page:

***

[!INCLUDE [invalid-args-cause-argumentexception](../../../includes/core-changes/windowsforms/5.0/invalid-args-cause-argumentexception.md)]

***

[!INCLUDE [null-args-cause-argumentnullexception](../../../includes/core-changes/windowsforms/5.0/null-args-cause-argumentnullexception.md)]

***
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### WinForms methods now throw ArgumentException

Some Windows Forms methods now throw an <xref:System.ArgumentException> for invalid arguments, where previously they did not.

#### Change description

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.

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.

The following table lists the affected methods and parameters:

| Method | Parameter name | Condition | Version added |
|-|-|-|
| <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 |

#### Version introduced

.NET 5.0 Preview 1

#### Recommended action

- Update the code to prevent passing invalid arguments.
- If necessary, handle an <xref:System.ArgumentException> when calling the method.

#### Category

Windows Forms

#### Affected APIs

- <xref:System.Windows.Forms.TabControl.GetToolTipText(System.Object)?displayProperty=fullName>

<!--

### Affected APIs

- `M:System.Windows.Forms.TabControl.GetToolTipText(System.Object)`

-->
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### WinForms APIs now throw ArgumentNullException
### WinForms methods now throw ArgumentNullException

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

Expand Down