Documented precedence for RemovePreviousVersion: All versus .NET 10

Manica Moscon Advogados 0 Reputation points
2026-11-04T17:31:30.72+00:00

The pinned Windows installation guide, under “Choose when previous versions are removed,” lists general All and version-specific .NET 10 settings for RemovePreviousVersion. It also states that invalid values default to always.

https://github.com/dotnet/docs/blob/951c3a5bdf253157f9b403e1f490bc42f5171fbc/docs/core/install/windows.md

What documented rule determines the effective value when both settings are present, and how is that value determined when the .NET 10 entry is absent or invalid?

Please provide a primary documentation reference and the relevant passage, preferably versioned where available. If the evidence comes from implementation rather than a published contract, please distinguish it. I am not assuming that an absent or invalid version-specific entry falls back to All.

This is a documentation clarification request. No registry access or changes, installations, or execution tests have been performed for this request.

Developer technologies | .NET | Other

1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-04T17:32:32.96+00:00

    The effective rule is: if the .NET 10-specific RemovePreviousVersion value exists, it takes precedence over All; if it is absent, the global All value is used; whichever selected value is invalid resolves to always.

    Published documentation

    The Windows installation guide documents both registry locations and the value normalization rules:

    | .NET version | Registry key | Name | Type | Value |
    | All | HKLM\SOFTWARE\Microsoft\.NET | RemovePreviousVersion | REG_SZ | always, never, or nextSession |
    | .NET 10 | HKLM\SOFTWARE\Microsoft\.NET\10.0 | RemovePreviousVersion | REG_SZ | always, never, or nextSession |

    It then states:

    always removes previous installations after the new version is installed. This is the default behavior in .NET.

    and:

    Values are case-insensitive and invalid values default to always.

    The feature applies only to standalone installer executables and is available starting with .NET 8 servicing release 8.0.11.^1^

    However, that published article does not currently state the precedence or fallback rule between the global and version-specific entries. Therefore, precedence is not established by that article alone.

    Precedence established by implementation work

    The change that introduced the registry searches states explicitly:

    The search operation will check for a global and version specific registry key. The version specific key takes precedence when present.

    That wording is in Arcade PR #14975.^2^

    The installer policy source implements separate searches for:

    • the global value under SOFTWARE\Microsoft\.NET;
    • existence of the version-specific value under SOFTWARE\Microsoft\.NET\<major>.<minor>;
    • the version-specific value, conditionally searched when that entry exists.^3^

    Consequently, the decision table for a .NET 10 standalone installer is:

    .NET\10.0 entry Global All entry Effective input Effective behavior
    Present and valid Any value or absent Version-specific value always, never, or nextSession
    Present but invalid Valid or absent Invalid version-specific value always
    Absent Present and valid Global value Global setting
    Absent Present but invalid Invalid global value always
    Absent Absent Default always

    The important distinction is that fallback is based on presence, not validity. An invalid .NET 10 value is still the selected version-specific value; it does not fall back to All. The documented invalid-value rule then converts it to always.

    Contract status

    • Published contract: accepted values are case-insensitive; invalid values and the default resolve to always; the global and per-version locations are supported.
    • Implementation-defined/documented in the introducing PR: a present version-specific entry overrides the global entry.
    • Documentation gap: the Learn article does not expressly say that absence triggers global fallback while an invalid version-specific value does not.

    A documentation clarification could state:

    The version-specific RemovePreviousVersion value takes precedence when present. If it is absent, the value under HKLM\SOFTWARE\Microsoft\.NET is used. After selecting the applicable value, values are evaluated case-insensitively, and an invalid or unavailable value defaults to always.


    References

    1. Install .NET on Windows
    2. #14975 Add registry search for upgrade policy keys
    3. arcade/src/Microsoft.DotNet.Build.Tasks.Installers/build/wix/bundle ...
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.