Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update NuGetCommands commands in XPlat to debug mode only - #6906

#6906
Merged
Nigusu-Allehu merged 2 commits into
devNuGet/NuGet.Client:devfrom
dev-nyenework-xplat-debugNuGet/NuGet.Client:dev-nyenework-xplat-debugCopy head branch name to clipboard
Nov 6, 2025
Merged

Update NuGetCommands commands in XPlat to debug mode only#6906
Nigusu-Allehu merged 2 commits into
devNuGet/NuGet.Client:devfrom
dev-nyenework-xplat-debugNuGet/NuGet.Client:dev-nyenework-xplat-debugCopy head branch name to clipboard

Conversation

@Nigusu-Allehu

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

Copy link
Copy Markdown
Member

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

@martinrrm martinrrm left a comment

Copy link
Copy Markdown
Contributor

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

jebriede commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.