Skip to content

Add the verbose output of the internal call to dotnet in dotnet-ef#37643

Open
AndriySvyryd wants to merge 1 commit intomainfrom
ToolingOutput
Open

Add the verbose output of the internal call to dotnet in dotnet-ef#37643
AndriySvyryd wants to merge 1 commit intomainfrom
ToolingOutput

Conversation

@AndriySvyryd
Copy link
Member

No description provided.

@AndriySvyryd AndriySvyryd requested a review from a team as a code owner February 6, 2026 23:54
Copilot AI review requested due to automatic review settings February 6, 2026 23:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances dotnet-ef diagnostics by adding verbose logging around the internal dotnet msbuild invocation used to extract project metadata.

Changes:

  • Add a new localized resource (RunningCommand) for verbose command execution messages.
  • Emit verbose output for the dotnet msbuild metadata call in Project.FromFile, including the captured output.
  • Regenerate/update the Resources.Designer.cs to reflect .resx changes.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/dotnet-ef/Properties/Resources.resx Adds RunningCommand string resource (and reorders some existing entries).
src/dotnet-ef/Properties/Resources.Designer.cs Updates strongly-typed resource accessors for the .resx changes.
src/dotnet-ef/Project.cs Adds verbose logging for the internal dotnet call and its output during project metadata retrieval.
Files not reviewed (1)
  • src/dotnet-ef/Properties/Resources.Designer.cs: Language not supported

Comment on lines +85 to +86
Reporter.WriteVerbose(Resources.RunningCommand("dotnet " + string.Join(" ", args)));

Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exe.Run already writes the executed command line to verbose output (and does correct quoting via Exe.ToArguments). The added RunningCommand("dotnet " + string.Join(" ", args)) duplicates that output and can be misleading for paths/args containing spaces since it doesn't quote/escape. Consider removing this line and instead passing processCommandLine to Exe.Run to wrap the already-formatted command string (or use Exe.ToArguments(args) when composing the message).

Suggested change
Reporter.WriteVerbose(Resources.RunningCommand("dotnet " + string.Join(" ", args)));

Copilot uses AI. Check for mistakes.
Comment on lines +98 to 100
Reporter.WriteVerbose(output.ToString());

var metadata = JsonSerializer.Deserialize<ProjectMetadata>(output.ToString())!;
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output.ToString() is called multiple times here (once for verbose logging and again for JSON deserialization), which allocates a new string each time. Consider materializing it once into a local variable and reusing it for both logging and JsonSerializer.Deserialize.

Suggested change
Reporter.WriteVerbose(output.ToString());
var metadata = JsonSerializer.Deserialize<ProjectMetadata>(output.ToString())!;
var outputString = output.ToString();
Reporter.WriteVerbose(outputString);
var metadata = JsonSerializer.Deserialize<ProjectMetadata>(outputString)!;

Copilot uses AI. Check for mistakes.
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.

2 participants