From 4117aefb38e2e3124181adbb7cc8831860944d2c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 19:59:23 +0000 Subject: [PATCH 1/8] Initial plan From 71878b622ea566d9529109eb3ca5361efcce3d2f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 20:02:03 +0000 Subject: [PATCH 2/8] Document the .NET Framework 4.5 SubsystemVersion retargeting change --- .../migration-guide/retargeting/4.5.x.md | 3 ++ .../subsystemversion-defaults-to-600.md | 33 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md diff --git a/docs/framework/migration-guide/retargeting/4.5.x.md b/docs/framework/migration-guide/retargeting/4.5.x.md index 67c82db66ddcc..f46fb48f2729c 100644 --- a/docs/framework/migration-guide/retargeting/4.5.x.md +++ b/docs/framework/migration-guide/retargeting/4.5.x.md @@ -3,6 +3,7 @@ title: Retargeting changes for migration to .NET Framework 4.5.x description: Find information about application compatibility issues that might affect your app when migrating to .NET Framework 4.5.x. ms.date: 07/31/2023 author: "chlowell" +ai-usage: ai-assisted --- # Retargeting changes for migration to .NET Framework 4.5.x @@ -43,6 +44,8 @@ This article lists the app compatibility issues that were introduced in .NET Fra [!INCLUDE[EncoderParameter ctor is obsolete](~/includes/migration-guide/retargeting/winforms/encoderparameter-ctor-obsolete.md)] +[!INCLUDE[SubsystemVersion defaults to 6.00 for .NET Framework 4.5 Windows Forms apps](~/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md)] + ### Windows Communication Foundation (WCF) [!INCLUDE [onwritebodycontents-change](~/includes/migration-guide/retargeting/wcf/onwritebodycontents-change.md)] diff --git a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md new file mode 100644 index 0000000000000..f7a8ba9236131 --- /dev/null +++ b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md @@ -0,0 +1,33 @@ +--- +ms.topic: include +ai-usage: ai-assisted +--- + +### SubsystemVersion defaults to 6.00 for .NET Framework 4.5 Windows Forms apps + +#### Details + +When you retarget a Windows Forms app to .NET Framework 4.5 and build it with MSBuild, the default `SubsystemVersion` changes from `4.00` to `6.00`. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than it did on .NET Framework 4. + +#### Suggestion + +Review code that sizes or positions Windows Forms UI with values or other `GetSystemMetrics`-based values. If you must preserve the .NET Framework 4 sizing behavior, set `SubsystemVersion` to `4.00` in your project file: + +```xml + + 4.00 + +``` + +You can also use the [**SubsystemVersion** compiler option for C#](/dotnet/csharp/language-reference/compiler-options/advanced#subsystemversion) or the [**-subsystemversion** compiler option for Visual Basic](/dotnet/visual-basic/reference/command-line-compiler/subsystemversion). + +| Name | Value | +|:--------|:------------| +| Scope | Edge | +| Version | 4.5 | +| Type | Retargeting | + +#### Affected APIs + +- +- From 7fd2f274659361e4277fdbc7f93cc8eb69c01b45 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 20:02:40 +0000 Subject: [PATCH 3/8] Address review feedback on SubsystemVersion retargeting docs --- .../retargeting/winforms/subsystemversion-defaults-to-600.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md index f7a8ba9236131..ad0bdba9de86e 100644 --- a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md +++ b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md @@ -7,7 +7,7 @@ ai-usage: ai-assisted #### Details -When you retarget a Windows Forms app to .NET Framework 4.5 and build it with MSBuild, the default `SubsystemVersion` changes from `4.00` to `6.00`. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than it did on .NET Framework 4. +For Windows Forms apps that you retarget to .NET Framework 4.5, the default `SubsystemVersion` changes from `4.00` to `6.00` when you build with MSBuild. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than it did on .NET Framework 4. #### Suggestion @@ -22,7 +22,7 @@ Review code that sizes or positions Windows Forms UI with Date: Fri, 26 Jun 2026 20:03:14 +0000 Subject: [PATCH 4/8] Refine SubsystemVersion retargeting doc wording --- .../winforms/subsystemversion-defaults-to-600.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md index ad0bdba9de86e..162d4f64650bc 100644 --- a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md +++ b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md @@ -7,11 +7,11 @@ ai-usage: ai-assisted #### Details -For Windows Forms apps that you retarget to .NET Framework 4.5, the default `SubsystemVersion` changes from `4.00` to `6.00` when you build with MSBuild. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than it did on .NET Framework 4. +When you build with MSBuild, the default `SubsystemVersion` changes from `4.00` to `6.00` for Windows Forms apps that you retarget to .NET Framework 4.5. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than it did on .NET Framework 4. #### Suggestion -Review code that sizes or positions Windows Forms UI with values or other `GetSystemMetrics`-based values. If you must preserve the .NET Framework 4 sizing behavior, set `SubsystemVersion` to `4.00` in your project file: +If you must preserve the .NET Framework 4 sizing behavior, set `SubsystemVersion` to `4.00` in your project file: ```xml @@ -21,6 +21,8 @@ Review code that sizes or positions Windows Forms UI with values or other `GetSystemMetrics`-based values. + | Name | Value | | ------- | ----------- | | Scope | Edge | From 9252ac2118b72246933388eed413328e29511eca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 20:03:49 +0000 Subject: [PATCH 5/8] Polish SubsystemVersion retargeting include wording --- .../winforms/subsystemversion-defaults-to-600.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md index 162d4f64650bc..ba878f9ccb652 100644 --- a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md +++ b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md @@ -3,11 +3,11 @@ ms.topic: include ai-usage: ai-assisted --- -### SubsystemVersion defaults to 6.00 for .NET Framework 4.5 Windows Forms apps +### SubsystemVersion defaults to 6.00 when you retarget Windows Forms applications to .NET Framework 4.5 #### Details -When you build with MSBuild, the default `SubsystemVersion` changes from `4.00` to `6.00` for Windows Forms apps that you retarget to .NET Framework 4.5. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than it did on .NET Framework 4. +When you build with MSBuild, the default `SubsystemVersion` changes from `4.00` to `6.00` for Windows Forms apps that you retarget to .NET Framework 4.5. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than the same code produced on .NET Framework 4. #### Suggestion @@ -19,7 +19,7 @@ If you must preserve the .NET Framework 4 sizing behavior, set `SubsystemVersion ``` -You can also use the [**SubsystemVersion** compiler option for C#](/dotnet/csharp/language-reference/compiler-options/advanced#subsystemversion) or the [**-subsystemversion** compiler option for Visual Basic](/dotnet/visual-basic/reference/command-line-compiler/subsystemversion). +You can also use the [SubsystemVersion compiler option for C#](/dotnet/csharp/language-reference/compiler-options/advanced#subsystemversion) or the [-subsystemversion compiler option for Visual Basic](/dotnet/visual-basic/reference/command-line-compiler/subsystemversion). Review code that sizes or positions Windows Forms UI with values or other `GetSystemMetrics`-based values. From 0b1b2bddaefefdf9c4b43f06bad211e96289fcb3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 20:04:22 +0000 Subject: [PATCH 6/8] Finalize SubsystemVersion retargeting documentation wording --- .../retargeting/winforms/subsystemversion-defaults-to-600.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md index ba878f9ccb652..2d4791789fadc 100644 --- a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md +++ b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md @@ -7,7 +7,7 @@ ai-usage: ai-assisted #### Details -When you build with MSBuild, the default `SubsystemVersion` changes from `4.00` to `6.00` for Windows Forms apps that you retarget to .NET Framework 4.5. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than the same code produced on .NET Framework 4. +When you build Windows Forms apps with MSBuild after retargeting to .NET Framework 4.5, the default `SubsystemVersion` changes from `4.00` to `6.00`. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than the same code produced on .NET Framework 4. #### Suggestion @@ -21,7 +21,7 @@ If you must preserve the .NET Framework 4 sizing behavior, set `SubsystemVersion You can also use the [SubsystemVersion compiler option for C#](/dotnet/csharp/language-reference/compiler-options/advanced#subsystemversion) or the [-subsystemversion compiler option for Visual Basic](/dotnet/visual-basic/reference/command-line-compiler/subsystemversion). -Review code that sizes or positions Windows Forms UI with values or other `GetSystemMetrics`-based values. +Review your code that sizes or positions Windows Forms UI with values or other `GetSystemMetrics`-based values. | Name | Value | | ------- | ----------- | From 2aef17045f154067eb3e64ad47dbb44080e1e526 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:31:40 -0700 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- .../retargeting/winforms/subsystemversion-defaults-to-600.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md index 2d4791789fadc..a2ee8527342e6 100644 --- a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md +++ b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md @@ -19,13 +19,13 @@ If you must preserve the .NET Framework 4 sizing behavior, set `SubsystemVersion ``` -You can also use the [SubsystemVersion compiler option for C#](/dotnet/csharp/language-reference/compiler-options/advanced#subsystemversion) or the [-subsystemversion compiler option for Visual Basic](/dotnet/visual-basic/reference/command-line-compiler/subsystemversion). +You can also use the [SubsystemVersion compiler option for C#](/dotnet/csharp/language-reference/compiler-options/advanced#subsystemversion) or the [SubsystemVersion compiler option for Visual Basic](/dotnet/visual-basic/reference/command-line-compiler/subsystemversion). Review your code that sizes or positions Windows Forms UI with values or other `GetSystemMetrics`-based values. | Name | Value | | ------- | ----------- | -| Scope | Edge | +| Scope | Minor | | Version | 4.5 | | Type | Retargeting | From 7d8bad466cdb5d1704885bc6fe9c4cf8ba6a7dd3 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:34:53 -0700 Subject: [PATCH 8/8] Apply suggestion from @adegeo --- .../retargeting/winforms/subsystemversion-defaults-to-600.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md index a2ee8527342e6..a11a82f13ed19 100644 --- a/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md +++ b/includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md @@ -7,7 +7,7 @@ ai-usage: ai-assisted #### Details -When you build Windows Forms apps with MSBuild after retargeting to .NET Framework 4.5, the default `SubsystemVersion` changes from `4.00` to `6.00`. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than the same code produced on .NET Framework 4. +When you build Windows Forms apps after retargeting to .NET Framework 4.5, the default `SubsystemVersion` changes from `4.00` to `6.00`. Windows uses the subsystem version when it reports some window metrics. As a result, code that calculates window or form sizes from values, such as , might produce different layout results than the same code produced on .NET Framework 4. #### Suggestion