From 4c4ed27356507874f97ba0a390d0a7f597d864a4 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 30 Sep 2025 13:23:30 +0300 Subject: [PATCH] refactor --- .../Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs | 2 +- .../Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs | 2 +- .../Building/Steps/RemoveProjectFromSolutionStep.cs | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs index 00e0bb0c2c..51ade9be0c 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs @@ -200,7 +200,7 @@ public abstract class ProjectCreationCommandBase throw new CliUsageException($"This command should be run inside a folder that contains a microservice solution! Or use -{Options.MainSolution.Short} parameter."); } - var microserviceSolutionName = Path.GetFileName(slnPath).RemovePostFix(".slnx").RemovePostFix(".sln"); + var microserviceSolutionName = Path.GetFileName(slnPath).RemovePostFix(".slnx", ".sln"); version ??= SolutionPackageVersionFinder.FindByCsprojVersion(slnPath); solutionName = SolutionName.Parse(microserviceSolutionName, projectName); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs index d09725cfbf..ae3cda8723 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs @@ -77,7 +77,7 @@ public class UpdateCommand : IConsoleCommand, ITransientDependency { foreach (var solution in solutions) { - var solutionName = Path.GetFileName(solution).RemovePostFix(".slnx").RemovePostFix(".sln"); + var solutionName = Path.GetFileName(solution).RemovePostFix(".slnx", ".sln"); await _nugetPackagesVersionUpdater.UpdateSolutionAsync(solution, checkAll: checkAll, version: version, leptonXVersion: leptonXVersion); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs index 3f3046a584..043693a75b 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs @@ -29,6 +29,11 @@ public class RemoveProjectFromSolutionStep : ProjectBuildPipelineStep { _solutionFilePathWithoutFileExtension = solutionFilePathWithoutFileExtension.RemovePostFix(".sln"); } + + if (solutionFilePathWithoutFileExtension != null && solutionFilePathWithoutFileExtension.EndsWith(".slnx")) + { + _solutionFilePathWithoutFileExtension = solutionFilePathWithoutFileExtension.RemovePostFix(".slnx"); + } else { _solutionFilePathWithoutFileExtension = solutionFilePathWithoutFileExtension;