From 3bca537669e8f2e4fc5034a1bbdcefc70ac1b2e2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 22:27:14 +0000 Subject: [PATCH 1/4] Initial plan From 718d1b9a8cae2225edbddf795b4e0281190f025d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 22:34:54 +0000 Subject: [PATCH 2/4] Add WPF MC3063 breaking change documentation for empty Grid definitions Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- docs/core/compatibility/10.0.md | 1 + docs/core/compatibility/toc.yml | 2 + .../wpf/10.0/empty-grid-definitions.md | 84 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 docs/core/compatibility/wpf/10.0/empty-grid-definitions.md diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index 6406589933843..baf1ce5ffe8eb 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -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 | |-------|---------------------------------------|--------------------| +| [WPF throws MC3063 error for empty ColumnDefinitions or RowDefinitions](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 | diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 9f99fed62c5cb..4603f91f9934a 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -130,6 +130,8 @@ items: href: windows-forms/10.0/statusstrip-renderer.md - name: WPF items: + - name: WPF throws MC3063 error for empty ColumnDefinitions or RowDefinitions + 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 diff --git a/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md b/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md new file mode 100644 index 0000000000000..04005f783fa67 --- /dev/null +++ b/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md @@ -0,0 +1,84 @@ +--- +title: "Breaking change - WPF throws MC3063 error for empty ColumnDefinitions or RowDefinitions" +description: "Learn about the breaking change in .NET 10 where empty Grid.ColumnDefinitions or Grid.RowDefinitions declarations now cause MC3063 compilation errors." +ms.date: 01/27/2025 +ai-usage: ai-assisted +ms.custom: https://github.com/dotnet/docs/issues/47743 +--- + +# WPF throws MC3063 error for empty ColumnDefinitions or RowDefinitions + +Starting with .NET 10 Preview 5, WPF applications fail to build if `` or `` are declared but left empty in XAML. This results in error **MC3063**, indicating that the property doesn't have a value. + +## Version introduced + +.NET 10 Preview 5 + +## Previous behavior + +WPF applications with empty `` or `` compiled successfully, even though the layout definitions were incomplete. WPF would default to a single row and column, placing all child elements in that single cell unless otherwise specified. + +Example that previously compiled: + +```xml + + + + + + + +``` + +## New behavior + +The same code now fails to compile with the following error: + +```output +error MC3063: Property 'ColumnDefinitions' does not have a value. +error MC3063: Property 'RowDefinitions' does not have a value. +``` + +This occurs when `` or `` elements are declared but contain no child `` or `` elements. + +## Type of breaking change + +This is a [source-incompatible](../../categories.md#source-compatibility) change. + +## Reason for change + +This change is a direct consequence of implementing Grid XAML Shorthand Syntax support. The enhancement improves XAML parsing by being more strict about property declarations that don't contain meaningful content. + +## Recommended action + +Choose one of the following approaches to resolve the compilation error: + +### Option 1: Remove empty declarations + +Remove the empty `` and `` elements entirely: + +```xml + + + +``` + +### Option 2: Add actual definitions + +If you need specific column or row definitions, add the appropriate `` or `` elements: + +```xml + + + + + + + + + +``` + +## Affected APIs + +None. From f8f38759123b9a8f182eb855c499cfb30bba3994 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 11 Aug 2025 19:53:29 -0700 Subject: [PATCH 3/4] human edits --- docs/core/compatibility/10.0.md | 2 +- docs/core/compatibility/toc.yml | 2 +- .../wpf/10.0/empty-grid-definitions.md | 38 +++++-------------- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index baf1ce5ffe8eb..d5880d3c27987 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -118,5 +118,5 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af | Title | Type of change | Introduced version | |-------|---------------------------------------|--------------------| -| [WPF throws MC3063 error for empty ColumnDefinitions or RowDefinitions](wpf/10.0/empty-grid-definitions.md) | Source incompatible | Preview 5 | +| [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 | diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 4603f91f9934a..c86e65b51010c 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -130,7 +130,7 @@ items: href: windows-forms/10.0/statusstrip-renderer.md - name: WPF items: - - name: WPF throws MC3063 error for empty ColumnDefinitions or RowDefinitions + - 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 diff --git a/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md b/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md index 04005f783fa67..84f98dde7ee5a 100644 --- a/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md +++ b/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md @@ -1,14 +1,14 @@ --- -title: "Breaking change - WPF throws MC3063 error for empty ColumnDefinitions or RowDefinitions" -description: "Learn about the breaking change in .NET 10 where empty Grid.ColumnDefinitions or Grid.RowDefinitions declarations now cause MC3063 compilation errors." -ms.date: 01/27/2025 +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 --- -# WPF throws MC3063 error for empty ColumnDefinitions or RowDefinitions +# Empty ColumnDefinitions and RowDefinitions are disallowed -Starting with .NET 10 Preview 5, WPF applications fail to build if `` or `` are declared but left empty in XAML. This results in error **MC3063**, indicating that the property doesn't have a value. +Starting with .NET 10, WPF applications fail to build if `` or `` are declared but left empty in XAML. This results in error `MC3063`, which indicates that the property doesn't have a value. ## Version introduced @@ -24,9 +24,6 @@ Example that previously compiled: - - - ``` @@ -36,46 +33,29 @@ The same code now fails to compile with the following error: ```output error MC3063: Property 'ColumnDefinitions' does not have a value. -error MC3063: Property 'RowDefinitions' does not have a value. ``` This occurs when `` or `` elements are declared but contain no child `` or `` elements. ## Type of breaking change -This is a [source-incompatible](../../categories.md#source-compatibility) 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. The enhancement improves XAML parsing by being more strict about property declarations that don't contain meaningful content. +This change is a direct consequence of implementing Grid XAML Shorthand Syntax support. ## Recommended action -Choose one of the following approaches to resolve the compilation error: +Ensure that all `` and `` contains at least one valid or element. -### Option 1: Remove empty declarations - -Remove the empty `` and `` elements entirely: - -```xml - - - -``` - -### Option 2: Add actual definitions - -If you need specific column or row definitions, add the appropriate `` or `` elements: +Corrected example: ```xml - - - - ``` From ecab3d0edeccb1e64bb8c761c5f17f92049d3d5c Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 11 Aug 2025 19:55:06 -0700 Subject: [PATCH 4/4] tweaks --- docs/core/compatibility/wpf/10.0/empty-grid-definitions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md b/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md index 84f98dde7ee5a..22fcd1e2983af 100644 --- a/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md +++ b/docs/core/compatibility/wpf/10.0/empty-grid-definitions.md @@ -16,7 +16,7 @@ Starting with .NET 10, WPF applications fail to build if `` or `` compiled successfully, even though the layout definitions were incomplete. WPF would default to a single row and column, placing all child elements in that single cell unless otherwise specified. +Previously, WPF applications with empty `` or `` 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: @@ -29,7 +29,7 @@ Example that previously compiled: ## New behavior -The same code now fails to compile with the following error: +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.