Skip to content

Update AppContext Switch Docs #3412

Open
Open

Description

@paulmedynski

MDS AppContext Switches are documented here:

https://learn.microsoft.com/en-us/sql/connect/ado-net/appcontext-switches?view=sql-server-ver16

That page lists the following switches:

  • DisableTNIRByDefaultInConnectionString
  • EnableRetryLogic
  • LegacyRowVersionNullBehavior
  • MakeReadAsyncBlocking
  • SuppressInsecureTLSWarning
  • TruncateScaledDecimal
  • UseManagedNetworkingOnWindows
  • UseOneSecFloorInTimeoutCalculationDuringLogin
  • UseSystemDefaultSecureProtocols

Those don't match the current code, which supports the following switches:

  • DisableTNIRByDefaultInConnectionString
  • LegacyRowVersionNullBehavior
  • LegacyVarTimeZeroScaleBehaviour
  • MakeReadAsyncBlocking
  • SuppressInsecureTLSWarning
  • TruncateScaledDecimal
  • UseCompatibilityAsyncBehaviour
  • UseCompatibilityProcessSni
  • UseConnectionPoolV2
  • UseOneSecFloorInTimeoutCalculationDuringLogin
  • UseManagedNetworkingOnWindows

Update the public docs to match reality, and find any other public docs that may also be inaccurate (README, BUILDGUIDE, etc).

Activity

  1. added
    Up-for-Grabs 🙌
    Area\Documentation
    on Jun 11, 2025
  2. moved this from To triage to Backlog in SqlClient Boardon Nov 21, 2025
  3. federico-paganini commented on Aug 24, 2026

    @federico-paganini

    I'd like to take this one — please assign it to me.

    The drift has widened since the OP: the page (last touched 2026-08) documents ~11 switches, while current main's LocalAppContextSwitches.cs carries 16+. Missing at least:

    • UseLegacyIdleTimeoutBehavior (default true) — gates whether Connection Idle Timeout (Add configurable idle connection timeout (ADO #39970) #4295, 7.1.0-preview2) is enforced at all; with the switch at its default the keyword parses but changes nothing.
    • UseConnectionPoolV2 (default false) — selects ChannelDbConnectionPool over the v1 pool.
    • LegacyVarTimeZeroScaleBehaviour (default true)
    • UseLegacyFailoverAlternationOnLoginSqlErrors (default false)
    • UseOverallConnectTimeoutForPoolWait (default false)

    Plan: a PR against MicrosoftDocs/sql-docs adding the missing sections in the page's existing format (defaults and semantics taken from the source), plus one cross-cutting note the page currently doesn't state anywhere: switch values are cached in statics on first read, so setting a switch after the first use of any SqlClient type is a silent no-op — we verified that empirically while validating #4295 (details in the #3667 thread).

  4. federico-paganini commented on Aug 24, 2026

    @federico-paganini

    PR is up: MicrosoftDocs/sql-docs#10381 — adds the five missing switches (sections in the page's existing format, defaults and introduction versions verified against LocalAppContextSwitches.cs and the release tags) plus a cross-cutting note that switch values are latched on first read.

    Two entries from the code-side inventory turned out not to belong on the page, for anyone auditing this later: UseMinimumLoginTimeout is a property name whose switch string is the already-documented UseOneSecFloorInTimeoutCalculationDuringLogin, and GlobalizationInvariantMode reads the runtime's System.Globalization.Invariant switch rather than a SqlClient one.

  5. priyankatiwari08 commented on Sep 17, 2026

    @priyankatiwari08
    Contributor

    /triage

  6. github-actions commented on Sep 17, 2026

    @github-actions

    🔍 Triage Summary (on-demand re-triage)

    Check Result
    Issue type Task
    Environment Not applicable (documentation task, no runtime repro required)
    Area Area\Documentation
    Duplicates None found
    Regression Not applicable

    Analysis

    This is a documentation-accuracy task: the public AppContext Switches doc page (learn.microsoft.com / MicrosoftDocs/sql-docs) lists switches that no longer match LocalAppContextSwitches.cs in main. Follow-up comments from @federico-paganini confirm the drift widened further (missing UseLegacyIdleTimeoutBehavior, UseConnectionPoolV2, LegacyVarTimeZeroScaleBehaviour, UseLegacyFailoverAlternationOnLoginSqlErrors, UseOverallConnectTimeoutForPoolWait), all of which are confirmed present in the current source (LocalAppContextSwitches.cs). A docs PR (MicrosoftDocs/sql-docs#10381) has already been opened to add the missing entries plus a note that switch values latch on first read. Severity: P3 (docs-only, no functional/runtime impact).

    Next Steps

    Note: This triage summary is auto-generated by an AI agent. The analysis and suggestions above have not been verified by a human maintainer. Please treat as preliminary guidance only.

    Generated by SqlClient Issue Auto-Triage for #3412 · copilot · auto · 40.9 AIC · ⌖ 13.1 AIC · ⊞ 11.9K · ◷

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area\DocumentationUp-for-Grabs 🙌

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions