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 6026ea96ca..942dd91067 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 @@ -26,6 +26,11 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps { SetSolutionAndProjectPathsIfNull(context); + if (_solutionFilePath == null || _projectFolderPath == null) + { + return; + } + new RemoveFolderStep(_projectFolderPath).Execute(context); var solutionFile = context.GetFile(_solutionFilePath); solutionFile.NormalizeLineEndings(); @@ -84,12 +89,12 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps if (_solutionFilePath == null) { _solutionFilePath = context.FindFile("/aspnet-core/MyCompanyName.MyProjectName.sln")?.Name ?? - context.FindFile("/MyCompanyName.MyProjectName.sln").Name; + context.FindFile("/MyCompanyName.MyProjectName.sln")?.Name; } if (_projectFolderPath == null) { _projectFolderPath = context.FindFile("/aspnet-core/src/" + _projectName.EnsureEndsWith('/'))?.Name ?? - context.FindFile("/src/" + _projectName.EnsureEndsWith('/')).Name; + context.FindFile("/src/" + _projectName.EnsureEndsWith('/'))?.Name; } } }