Repository navigation
Include the original error in NuGet.Config failure messages - #7843
Merged
Nigusu-Allehu merged 1 commit intoNov 4, 2026
Merged
Conversation
jeffkl
approved these changes
Nov 2, 2026
zivkan
approved these changes
Nov 3, 2026
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Fixes: NuGet/Home#12651
Description
SettingsFile.ExecuteSynchronizedalready passese.Messageto its four error strings, but the strings only use{0}, so the original error never shows up. For a broken config you only getNuGet.Config is not valid XML. Path: '...'., with no line number or reason.I added
Reason: {1}toShowError_ConfigInvalidOperation,ShowError_ConfigInvalidXml,ShowError_ConfigUnauthorizedAccessandUnknown_Config_Exception, the same wordingShowError_ConfigHasInvalidPackageSourceuses, with a comment for translators. No code changes were needed.UpdateXlfresets these four translations tostate="new"because a placeholder was added, so they show in English until they're translated again. The build doesn't regenerateResources.Designer.cs, so I updated its doc comments by hand.Tests: I updated the assertions that matched the old message exactly:
SettingsFile_Constructor_WithMalformedConfig_ThrowsandSettingsFile_Constructor_InvalidXml_ThrowsSavePackageSources_ThrowWhenConfigReadOnlyResolve_WhenNuGetConfigUnreadable_ReturnsFailedSdkResultAndLogsErrorThey fail on
devwith the new assertions.On net10.0,
NuGet.Configuration.Test: 672 passed, 6 skipped.Microsoft.Build.NuGetSdkResolver.Test: 64 passed.PR Checklist