Skip to content

Document the .NET Framework 4.5 SubsystemVersion retargeting change for Windows Forms#54553

Open
Copilot wants to merge 8 commits into
mainfrom
copilot/add-missing-docs-subsystemversion
Open

Document the .NET Framework 4.5 SubsystemVersion retargeting change for Windows Forms#54553
Copilot wants to merge 8 commits into
mainfrom
copilot/add-missing-docs-subsystemversion

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The .NET Framework 4.5 retargeting guide didn't mention that MSBuild changes the default SubsystemVersion from 4.00 to 6.00. That omission leaves a gap for Windows Forms apps that calculate layout from SystemInformation or other GetSystemMetrics-based values and can see size changes after retargeting.

  • What changed

    • Added a new Windows Forms retargeting include that documents the SubsystemVersion default change for .NET Framework 4.5.
    • Inserted the new include into docs/framework/migration-guide/retargeting/4.5.x.md under .NET Framework 4.5 > Windows Forms, immediately after the existing EncoderParameter ctor is obsolete entry.
    • Added the required ai-usage frontmatter to the edited article.
  • What the new guidance covers

    • The default SubsystemVersion changes from 4.00 to 6.00 when you retarget to .NET Framework 4.5 and build with MSBuild.
    • Windows can report different window metrics under that subsystem version.
    • Windows Forms code that uses xref:System.Windows.Forms.SystemInformation values, such as xref:System.Windows.Forms.SystemInformation.FixedFrameBorderSize, can produce different layout results.
    • A workaround is available when an app must preserve .NET Framework 4 sizing behavior.
  • Workaround example

    <PropertyGroup>
      <SubsystemVersion>4.00</SubsystemVersion>
    </PropertyGroup>

Internal previews

📄 File 🔗 Preview link
docs/framework/migration-guide/retargeting/4.5.x.md Retargeting changes for migration to .NET Framework 4.5.x

Copilot AI requested review from Copilot and removed request for Copilot June 26, 2026 19:59
Copilot AI requested review from Copilot and removed request for Copilot June 26, 2026 20:02
Copilot AI requested review from Copilot and removed request for Copilot June 26, 2026 20:02
Copilot AI requested review from Copilot and removed request for Copilot June 26, 2026 20:03
Copilot AI requested review from Copilot and removed request for Copilot June 26, 2026 20:03
Copilot AI requested review from Copilot and removed request for Copilot June 26, 2026 20:04
Copilot AI changed the title [WIP] Add missing documentation for SubsystemVersion change Document the .NET Framework 4.5 SubsystemVersion retargeting change for Windows Forms Jun 26, 2026
Copilot AI requested a review from adegeo June 26, 2026 20:04
Comment thread includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md Outdated
Comment thread includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md Outdated
Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 26, 2026 20:31
Comment thread includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md Outdated
@adegeo adegeo marked this pull request as ready for review June 26, 2026 20:35
@adegeo adegeo requested review from a team and gewarren as code owners June 26, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fills a gap in the .NET Framework 4.5 retargeting guide by documenting that MSBuild changes the default SubsystemVersion from 4.00 to 6.00, which can affect Windows Forms layout when apps rely on SystemInformation or other GetSystemMetrics-derived values.

Changes:

  • Added a new Windows Forms retargeting include that explains the SubsystemVersion default change and a workaround.
  • Inserted the new include into the .NET Framework 4.5 section of the retargeting guide.
  • Added ai-usage: ai-assisted frontmatter to the edited article.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
includes/migration-guide/retargeting/winforms/subsystemversion-defaults-to-600.md New include documenting the SubsystemVersion default change, impact, and workaround.
docs/framework/migration-guide/retargeting/4.5.x.md Adds ai-usage metadata and includes the new Windows Forms retargeting entry.

</PropertyGroup>
```

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).
Comment on lines +26 to +30
| Name | Value |
| ------- | ----------- |
| Scope | Minor |
| Version | 4.5 |
| Type | Retargeting |

@gewarren gewarren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it doesn't need a TOC entry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing docs: SubsystemVersion changed to 6.00 starting with .NET 4.5

4 participants