additional unparseable file message#14464
Merged
Merged
Conversation
c61026f to
0c5866c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Improves NuGet helper error detection so Dependabot can surface a clearer “dependency file not parseable” error when packages.config parsing fails during MSBuild/NuGet operations.
Changes:
- Adds a new MSBuild output regex to detect
packages.configparsing failures and extract file path + message. - Adds a corresponding unit test case covering the new error output format.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs |
Adds an additional regex pattern for packages.config parse errors in ThrowOnUnparseableFile. |
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs |
Adds a fixture output + expected error mapping for the new regex. |
Comment on lines
729
to
+731
| new Regex(@"\nAn error occurred while reading file '(?<FilePath>[^']+)': (?<Message>[^\n]*)\n"), | ||
| new Regex(@"NuGet\.Config is not valid XML\. Path: '(?<FilePath>[^']+)'\.\n\s*(?<Message>[^\n]*)(\n|$)"), | ||
| new Regex(@"Error parsing packages\.config file at (?<FilePath>[^:]+): (?<Message>[^\n]*)\n"), |
Comment on lines
+643
to
+644
|
|
||
| ^^^ this blank line is necessary to force a newline at the end of the output |
| { | ||
| new Regex(@"\nAn error occurred while reading file '(?<FilePath>[^']+)': (?<Message>[^\n]*)\n"), | ||
| new Regex(@"NuGet\.Config is not valid XML\. Path: '(?<FilePath>[^']+)'\.\n\s*(?<Message>[^\n]*)(\n|$)"), | ||
| new Regex(@"Error parsing packages\.config file at (?<FilePath>[^:]+): (?<Message>[^\n]*)\n"), |
VXianOng
approved these changes
Mar 16, 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.
From scanning the error reporting, I found a scenario where it was really easy to pull out the error of an unparsable
packages.configfile.