Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/dotnet-ef/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public static Project FromFile(

var output = new StringBuilder();

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

Comment on lines +85 to +86
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.
var exitCode = Exe.Run("dotnet", args, handleOutput: line => output.AppendLine(line));
if (exitCode != 0)
{
Expand All @@ -93,6 +95,8 @@ public static Project FromFile(
throw new CommandException(Resources.GetMetadataFailed);
}

Reporter.WriteVerbose(output.ToString());

var metadata = JsonSerializer.Deserialize<ProjectMetadata>(output.ToString())!;
Comment on lines +98 to 100
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.

var runtimeCopyLocalItems = metadata.Items["RuntimeCopyLocalItems"];
Expand Down
45 changes: 23 additions & 22 deletions src/dotnet-ef/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions src/dotnet-ef/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@
<data name="DatabaseDropForceDescription" xml:space="preserve">
<value>Don't confirm.</value>
</data>
<data name="DatabaseUpdateDescription" xml:space="preserve">
<value>Updates the database to a specified migration.</value>
</data>
<data name="DatabaseUpdateAddDescription" xml:space="preserve">
<value>Create a new migration with the given name and apply it immediately.</value>
</data>
<data name="DatabaseUpdateDescription" xml:space="preserve">
<value>Updates the database to a specified migration.</value>
</data>
<data name="DbContextConnectionDescription" xml:space="preserve">
<value>The connection string to the database. Defaults to the one specified in AddDbContext or OnConfiguring.</value>
</data>
Expand Down Expand Up @@ -216,9 +216,6 @@
<data name="MigrationNameDescription" xml:space="preserve">
<value>The name of the migration.</value>
</data>
<data name="MissingArgument" xml:space="preserve">
<value>Missing required argument '{arg}'.</value>
</data>
<data name="MigrationsAddDescription" xml:space="preserve">
<value>Adds a new migration.</value>
</data>
Expand Down Expand Up @@ -258,6 +255,9 @@
<data name="MigrationToDescription" xml:space="preserve">
<value>The target migration. Defaults to the last migration.</value>
</data>
<data name="MissingArgument" xml:space="preserve">
<value>Missing required argument '{arg}'.</value>
</data>
<data name="MissingConditionalOption" xml:space="preserve">
<value>Option '--{requiredOption}' must be specified if '--{conditionalOption}' is used.</value>
</data>
Expand Down Expand Up @@ -336,6 +336,9 @@
<data name="ProviderDescription" xml:space="preserve">
<value>The provider to use. (E.g. Microsoft.EntityFrameworkCore.SqlServer)</value>
</data>
<data name="RunningCommand" xml:space="preserve">
<value>Running '{command}'</value>
</data>
<data name="RuntimeDescription" xml:space="preserve">
<value>The runtime to use.</value>
</data>
Expand Down Expand Up @@ -378,4 +381,4 @@
<data name="WritingFile" xml:space="preserve">
<value>Writing '{file}'...</value>
</data>
</root>
</root>
Loading