Skip to content
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
1 change: 1 addition & 0 deletions docs/core/compatibility/10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af

| Title | Type of change | Introduced version |
|-------|---------------------------------------|--------------------|
| [Empty ColumnDefinitions and RowDefinitions are disallowed](wpf/10.0/empty-grid-definitions.md) | Source incompatible | Preview 5 |
| [Incorrect usage of DynamicResource causes application crash](wpf/10.0/dynamicresource-crash.md) | Source incompatible/behavioral change | Preview 4 |
2 changes: 2 additions & 0 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ items:
href: windows-forms/10.0/statusstrip-renderer.md
- name: WPF
items:
- name: Empty ColumnDefinitions and RowDefinitions are disallowed
href: wpf/10.0/empty-grid-definitions.md
- name: Incorrect usage of DynamicResource causes application crash
href: wpf/10.0/dynamicresource-crash.md
- name: .NET 9
Expand Down
64 changes: 64 additions & 0 deletions docs/core/compatibility/wpf/10.0/empty-grid-definitions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "Breaking change - Empty ColumnDefinitions and RowDefinitions are disallowed"
description: "Learn about the breaking change in WPF in .NET 10 where empty Grid.ColumnDefinitions or Grid.RowDefinitions declarations now cause MC3063 compilation errors."
ms.date: 08/11/2025
ai-usage: ai-assisted
ms.custom: https://github.com/dotnet/docs/issues/47743
---

# Empty ColumnDefinitions and RowDefinitions are disallowed

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.

## Version introduced

.NET 10 Preview 5

## Previous behavior

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.

Example that previously compiled:

```xml
<Grid>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
</Grid>
```

## New behavior

Starting in .NET 10, the same code now fails to compile with the following error:

```output
error MC3063: Property 'ColumnDefinitions' does not have a value.
```

This occurs when `<Grid.ColumnDefinitions>` or `<Grid.RowDefinitions>` elements are declared but contain no child `<ColumnDefinition />` or `<RowDefinition />` elements.

## Type of breaking change

This change can affect [source compatibility](../../categories.md#source-compatibility).

## Reason for change

This change is a direct consequence of implementing Grid XAML Shorthand Syntax support.

## Recommended action

Ensure that all `<Grid.ColumnDefinitions>` and `<Grid.RowDefinitions>` contains at least one valid or element.

Corrected example:

```xml
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
</Grid>
```

## Affected APIs

None.