Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 29, 2025

Two AppContext switches from the .NET Framework June 2019 cumulative update were missing from the documentation.

Changes

  • Added Switch.MS.Internal.EnableCleanupSchedulingImprovements - controls WPF cleanup scheduling improvements to reduce memory usage
  • Added Switch.MS.Internal.EnableWeakEventMemoryImprovements - controls WPF weak event pattern memory improvements to prevent leaks

Both switches are documented as introduced in .NET Framework 4.7.2 and follow the existing table format.

Example Usage

<configuration>
  <runtime>
    <AppContextSwitchOverrides value="Switch.MS.Internal.EnableWeakEventMemoryImprovements=true;Switch.MS.Internal.EnableCleanupSchedulingImprovements=true" />
  </runtime>
</configuration>

Fixes #40651

Original prompt

This section details on the original issue you should resolve

<issue_title>Appcontext Switches are missing</issue_title>
<issue_description>### Type of issue

Missing information

Description

The switches from
https://devblogs.microsoft.com/dotnet/net-framework-june-27-2019-cumulative-update-for-windows-10-version-1903/
are not listed here. Please add them.

  • Switch.MS.Internal.EnableWeakEventMemoryImprovements
  • Switch.MS.Internal.EnableCleanupSchedulingImprovements.

Page URL

https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element

Content source URL

https://github.com/dotnet/docs/blob/main/docs/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md

Document Version Independent Id

19747ce7-da26-bf2e-5066-1df11e61b0d0

Platform Id

c592b8c1-2bf3-7caf-02ca-251011a50645

Article author

@gewarren

Metadata

  • ID: e59350ee-7837-34f8-b50e-c9c136720155
  • PlatformId: c592b8c1-2bf3-7caf-02ca-251011a50645
  • Service: dotnet-framework

Related Issues</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Internal previews

📄 File 🔗 Preview link
docs/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md <AppContextSwitchOverrides> element

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copilot AI changed the title [WIP] Add missing Appcontext switches to documentation Add missing WPF memory improvement AppContext switches Oct 29, 2025
Copilot AI requested a review from gewarren October 29, 2025 21:31
Copilot finished work on behalf of gewarren October 29, 2025 21:31
@gewarren gewarren marked this pull request as ready for review October 29, 2025 21:39
@gewarren gewarren requested a review from a team as a code owner October 29, 2025 21:39
Copilot AI review requested due to automatic review settings October 29, 2025 21:39
Copy link
Contributor

Copilot AI left a comment

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 adds documentation for two new AppContext switches related to WPF weak-event pattern improvements. The additions document switches that control cleanup scheduling and memory allocation behavior for the weak-event pattern.

  • Adds Switch.MS.Internal.EnableCleanupSchedulingImprovements switch documentation.
  • Adds Switch.MS.Internal.EnableWeakEventMemoryImprovements switch documentation.

@gewarren gewarren closed this Oct 29, 2025
@gewarren gewarren reopened this Oct 29, 2025
@gewarren gewarren closed this Oct 29, 2025
@gewarren gewarren reopened this Oct 29, 2025
@BillWagner BillWagner closed this Oct 30, 2025
@BillWagner BillWagner reopened this Oct 30, 2025
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This LGTM. Let's :shipit:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Appcontext Switches are missing

3 participants