Add --delete-source option and interactive prompt to project convert#52802
Open
Copilot wants to merge 8 commits intorelease/10.0.3xxfrom
Open
Add --delete-source option and interactive prompt to project convert#52802Copilot wants to merge 8 commits intorelease/10.0.3xxfrom
Copilot wants to merge 8 commits intorelease/10.0.3xxfrom
Conversation
…command Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
… improve test assertions Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with leftover .cs file during project conversion
Add --delete-source option and interactive prompt to project convert
Feb 3, 2026
jjonescz
reviewed
Feb 3, 2026
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Outdated
Show resolved
Hide resolved
test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs
Show resolved
Hide resolved
test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs
Show resolved
Hide resolved
…ts, migrate to Spectre.Console, add tests with default files Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
jjonescz
reviewed
Feb 3, 2026
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Outdated
Show resolved
Hide resolved
…ory validation Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
jjonescz
reviewed
Feb 3, 2026
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Outdated
Show resolved
Hide resolved
…directory prompt Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
jjonescz
reviewed
Feb 3, 2026
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Outdated
Show resolved
Hide resolved
…nsole Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
jjonescz
approved these changes
Feb 3, 2026
MiYanni
approved these changes
Feb 4, 2026
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.
--delete-sourcecommand-line option to ProjectConvertCommandDefinition--delete-sourceflag (file should be deleted)--dry-runand--delete-sourceflags--delete-sourceDeleteSourceFileto local functionDeleteFile(likeCreateDirectory/CopyFile)TryAskForOutputDirectoryto Spectre.Console for consistencyInteractiveConsole.Askmethod_interactivefield to avoid repeated_parseResult.GetValue<bool>(CommonOptions.InteractiveOptionName)callsDetermineOutputDirectoryby inlining the prompt logicValidatordelegate fromInteractiveConsoleInteractiveConsoleSummary
This implementation adds a
--delete-sourcecommand-line option and an interactive prompt todotnet project convertthat allows users to choose whether to delete the original source file after conversion.Key Features:
--delete-sourceflag deletes the source file after successful conversion--interactiveflag (and no--delete-source), users are prompted via Spectre.Console--dry-runflag to preview actions_interactivefield, inlined prompt, and removed unused codeOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.