Skip to content

Deprecate NUGET_USE_LEGACY_ASSET_TARGET_FALLBACK_DEPENDENCY_RESOLUTION - #7722

Closed
nkolev92 with Copilot wants to merge 2 commits into
devfrom
copilot/deprecate-nuget-use-legacy-asset
Closed

nkolev92 with Copilot wants to merge 2 commits into
devfrom
copilot/deprecate-nuget-use-legacy-asset

Conversation

Copilot AI commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#14824

Description

NUGET_USE_LEGACY_ASSET_TARGET_FALLBACK_DEPENDENCY_RESOLUTION was added in 6.2 to let users opt back into the pre-6.2 (legacy) dependency resolution behavior for AssetTargetFallback. Telemetry shows 0 usage of the variable, so it's safe to remove.

This PR:

  • Removes the environment variable read and the _useLegacyAssetTargetFallbackBehavior field/branching in PackageSpecReferenceDependencyProvider and SourceRepositoryDependencyProvider. The AssetTargetFallback-aware dependency resolution (previously the default unless the variable was set to true) now always runs unconditionally.
  • Removes the UsesLegacyAssetTargetFallback telemetry event and its constant from RestoreCommand, per the request on the linked issue to remove the telemetry alongside the variable.
  • Updates/removes tests that exercised the legacy env var toggle to reflect the simplified, unconditional behavior.

Clean-up of any now-unused code paths elsewhere is intentionally left as a follow-up, as noted on the issue.

PR Checklist

…nv var and its telemetry

Co-authored-by: nkolev92 <2878341+nkolev92@users.noreply.github.com>
Copilot AI changed the title [WIP] Deprecate NUGET_USE_LEGACY_ASSET_TARGET_FALLBACK_DEPENDENCY_RESOLUTION in .NET 11 Deprecate NUGET_USE_LEGACY_ASSET_TARGET_FALLBACK_DEPENDENCY_RESOLUTION Sep 18, 2026
Copilot AI requested a review from nkolev92 September 18, 2026 17:42
@nkolev92
nkolev92 marked this pull request as ready for review September 18, 2026 18:18
@nkolev92
nkolev92 requested a review from a team as a code owner September 18, 2026 18:18
@nkolev92
nkolev92 requested a review from martinrrm September 18, 2026 18:18
@nkolev92 nkolev92 closed this Sep 22, 2026
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.

Deprecate NUGET_USE_LEGACY_ASSET_TARGET_FALLBACK_DEPENDENCY_RESOLUTION in .NET 12

3 participants