Skip to content

Conversation

@lbussell
Copy link
Member

@lbussell lbussell commented Feb 9, 2026

Summary

Fix a bug where applying an internal preview .NET version via
update-dependencies would remove all authenticated NuGet feed credentials
from the test NuGet.config, not just the current version's entry.

Changes

  • Change UpdatePackageSourceCredentials to only remove the current version's
    credential entry from <packageSourceCredentials> instead of removing the
    entire element
  • Clean up the parent element only when it has no remaining entries
  • Add XML documentation to the method

Context

When an internal build of a public preview .NET version was applied (e.g. .NET
11 Preview), the else branch of UpdatePackageSourceCredentials called
pkgSourceCreds?.Remove(), which wiped the entire <packageSourceCredentials>
element — including credentials for other non-preview versions (e.g. .NET 9)
that still need authenticated feed access.

When an internal preview version was applied, the
UpdatePackageSourceCredentials method removed the entire
packageSourceCredentials element, wiping credentials for all
versions. Now only the current version's entry is removed,
preserving credentials for other versions that need authenticated
feed access.
@lbussell lbussell requested a review from a team as a code owner February 9, 2026 22:10
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.

1 participant