Skip to content

Conversation

@Nigusu-Allehu
Copy link
Member

@Nigusu-Allehu Nigusu-Allehu commented Oct 28, 2025

Bug

Fixes: #6804 (comment)

Description

Update XPlat debug commands to be registered only during DEBUG builds.

  • The NuGetCommands class is used by the .NET SDK CLI to register NuGet commands. https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.CommandLine.XPlat/NuGetCommands.cs
  • Currently, it is implemented only by the update command, but future dotnet nuget client commands will also use this class.
  • To support live debugging, these commands are registered in the NuGet.CommandLine.XPlat entry point.
  • Since this registration is intended solely for debugging, this PR ensures the commands are registered only in debug builds.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@Nigusu-Allehu Nigusu-Allehu requested a review from a team as a code owner October 28, 2025 00:42
@Nigusu-Allehu Nigusu-Allehu self-assigned this Oct 28, 2025
martinrrm
martinrrm previously approved these changes Oct 28, 2025
Copy link
Contributor

@martinrrm martinrrm left a comment

Choose a reason for hiding this comment

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

Interesting... I wasn't aware that we needed to add the register if we wanted to debug the update command, thanks you potentially saved us time for future development.

Also, consider updating the title to say UpdateCommand only, I thought this was for all.

jebriede
jebriede previously approved these changes Oct 28, 2025
@jebriede
Copy link
Contributor

jebriede commented Oct 28, 2025

Interesting... I wasn't aware that we needed to add the register if we wanted to debug the update command, thanks you potentially saved us time for future development.

Also, consider updating the title to say UpdateCommand only, I thought this was for all.

I agree with the suggestion to update the title to explain which command is being addressed.

@Nigusu-Allehu
Copy link
Member Author

Interesting... I wasn't aware that we needed to add the register if we wanted to debug the update command, thanks you potentially saved us time for future development.

Also, consider updating the title to say UpdateCommand only, I thought this was for all.

Thanks for the note! I used NuGetCommands in the title because the intent is for this change to apply it to all commands registered under NuGetCommands. Right now, only the Update Command implements it, which is why it looks specific to that one. But the goal is to make the pattern consistent for all future NuGetCommands commands.

jeffkl
jeffkl previously approved these changes Oct 28, 2025
@Nigusu-Allehu Nigusu-Allehu merged commit a55079f into dev Nov 6, 2025
17 of 18 checks passed
@Nigusu-Allehu Nigusu-Allehu deleted the dev-nyenework-xplat-debug branch November 6, 2025 00:17
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.

5 participants