Fix dotnet test crash on empty, invalid, or unreadable global.json#52386
Draft
Copilot wants to merge 6 commits intorelease/10.0.2xxfrom
Draft
Fix dotnet test crash on empty, invalid, or unreadable global.json#52386Copilot wants to merge 6 commits intorelease/10.0.2xxfrom
Copilot wants to merge 6 commits intorelease/10.0.2xxfrom
Conversation
Co-authored-by: tmat <41759+tmat@users.noreply.github.com>
Co-authored-by: tmat <41759+tmat@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix dotnet test command failure with unreadable global.json
Fix dotnet test crash on empty or invalid global.json
Jan 9, 2026
tmat
reviewed
Jan 9, 2026
| @@ -38,14 +38,23 @@ public static TestCommandDefinition Create() | |||
|
|
|||
| string jsonText = File.ReadAllText(globalJsonPath); | |||
Member
There was a problem hiding this comment.
@copilot Also handle exception from File.ReadAllText
Member
There was a problem hiding this comment.
@copilot Also handle exception from File.ReadAllText
Contributor
Author
There was a problem hiding this comment.
Added exception handling for File.ReadAllText to catch I/O errors and permission issues. Commit: 400138a
Co-authored-by: tmat <41759+tmat@users.noreply.github.com>
Co-authored-by: tmat <41759+tmat@users.noreply.github.com>
Copilot
AI
changed the title
Fix dotnet test crash on empty or invalid global.json
Fix dotnet test crash on empty, invalid, or unreadable global.json
Jan 11, 2026
tmat
reviewed
Jan 11, 2026
Co-authored-by: tmat <41759+tmat@users.noreply.github.com>
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.
Fix dotnet test command failure when global.json is unreadable
Summary
Fixed crashes in
dotnet testcommand when encountering:All scenarios now default to VSTest, matching the behavior when no global.json exists. Uses broad exception handling for File.ReadAllText to catch all possible file access errors.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.