Skip to content

Commit 17acabc

Browse files
authored
Add WPF breaking change documentation for MC3063 error with empty Grid definitions (#47923)
1 parent 7a8ded4 commit 17acabc

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

docs/core/compatibility/10.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,5 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
129129

130130
| Title | Type of change | Introduced version |
131131
|-------|---------------------------------------|--------------------|
132+
| [Empty ColumnDefinitions and RowDefinitions are disallowed](wpf/10.0/empty-grid-definitions.md) | Source incompatible | Preview 5 |
132133
| [Incorrect usage of DynamicResource causes application crash](wpf/10.0/dynamicresource-crash.md) | Source incompatible/behavioral change | Preview 4 |

docs/core/compatibility/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ items:
144144
href: windows-forms/10.0/statusstrip-renderer.md
145145
- name: WPF
146146
items:
147+
- name: Empty ColumnDefinitions and RowDefinitions are disallowed
148+
href: wpf/10.0/empty-grid-definitions.md
147149
- name: Incorrect usage of DynamicResource causes application crash
148150
href: wpf/10.0/dynamicresource-crash.md
149151
- name: .NET 9
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: "Breaking change - Empty ColumnDefinitions and RowDefinitions are disallowed"
3+
description: "Learn about the breaking change in WPF in .NET 10 where empty Grid.ColumnDefinitions or Grid.RowDefinitions declarations now cause MC3063 compilation errors."
4+
ms.date: 08/11/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/docs/issues/47743
7+
---
8+
9+
# Empty ColumnDefinitions and RowDefinitions are disallowed
10+
11+
Starting with .NET 10, WPF applications fail to build if `<Grid.ColumnDefinitions>` or `<Grid.RowDefinitions>` are declared but left empty in XAML. This results in error `MC3063`, which indicates that the property doesn't have a value.
12+
13+
## Version introduced
14+
15+
.NET 10 Preview 5
16+
17+
## Previous behavior
18+
19+
Previously, WPF applications with empty `<Grid.ColumnDefinitions>` or `<Grid.RowDefinitions>` compiled successfully, even though the layout definitions were incomplete. The layout defaulted to a single row and column, placing all child elements in that single cell unless otherwise specified.
20+
21+
Example that previously compiled:
22+
23+
```xml
24+
<Grid>
25+
<Grid.ColumnDefinitions>
26+
</Grid.ColumnDefinitions>
27+
</Grid>
28+
```
29+
30+
## New behavior
31+
32+
Starting in .NET 10, the same code now fails to compile with the following error:
33+
34+
```output
35+
error MC3063: Property 'ColumnDefinitions' does not have a value.
36+
```
37+
38+
This occurs when `<Grid.ColumnDefinitions>` or `<Grid.RowDefinitions>` elements are declared but contain no child `<ColumnDefinition />` or `<RowDefinition />` elements.
39+
40+
## Type of breaking change
41+
42+
This change can affect [source compatibility](../../categories.md#source-compatibility).
43+
44+
## Reason for change
45+
46+
This change is a direct consequence of implementing Grid XAML Shorthand Syntax support.
47+
48+
## Recommended action
49+
50+
Ensure that all `<Grid.ColumnDefinitions>` and `<Grid.RowDefinitions>` contains at least one valid or element.
51+
52+
Corrected example:
53+
54+
```xml
55+
<Grid>
56+
<Grid.ColumnDefinitions>
57+
<ColumnDefinition />
58+
</Grid.ColumnDefinitions>
59+
</Grid>
60+
```
61+
62+
## Affected APIs
63+
64+
None.

0 commit comments

Comments
 (0)