diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index b6fd6e20759..a75a8ff5dd3 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -19,6 +19,7 @@ using Volo.Abp.Cli.ProjectBuilding.Templates.App; using Volo.Abp.Cli.ProjectModification; using Volo.Abp.Cli.Utils; +using Volo.Abp.Cli.Version; using Volo.Abp.DependencyInjection; using Volo.Abp.EventBus.Local; @@ -44,7 +45,8 @@ public NewCommand( IBundlingService bundlingService, ITemplateInfoProvider templateInfoProvider, TemplateProjectBuilder templateProjectBuilder, - AngularThemeConfigurer angularThemeConfigurer) : + AngularThemeConfigurer angularThemeConfigurer, + CliVersionService cliVersionService) : base(connectionStringProvider, solutionPackageVersionFinder, cmdHelper, @@ -55,7 +57,8 @@ public NewCommand( themePackageAdder, eventBus, bundlingService, - angularThemeConfigurer) + angularThemeConfigurer, + cliVersionService) { TemplateInfoProvider = templateInfoProvider; TemplateProjectBuilder = templateProjectBuilder; 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 a2226fa6e29..506997ef9c1 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 @@ -22,6 +22,7 @@ using Volo.Abp.Cli.ProjectBuilding.Templates.Module; using Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule; using Volo.Abp.Cli.Utils; +using Volo.Abp.Cli.Version; using Volo.Abp.EventBus.Local; namespace Volo.Abp.Cli.Commands; @@ -42,6 +43,8 @@ public abstract class ProjectCreationCommandBase public ThemePackageAdder ThemePackageAdder { get; } public AngularThemeConfigurer AngularThemeConfigurer { get; } + + public CliVersionService CliVersionService { get; } public ProjectCreationCommandBase( ConnectionStringProvider connectionStringProvider, @@ -54,7 +57,8 @@ public ProjectCreationCommandBase( ThemePackageAdder themePackageAdder, ILocalEventBus eventBus, IBundlingService bundlingService, - AngularThemeConfigurer angularThemeConfigurer) + AngularThemeConfigurer angularThemeConfigurer, + CliVersionService cliVersionService) { _bundlingService = bundlingService; ConnectionStringProvider = connectionStringProvider; @@ -67,6 +71,7 @@ public ProjectCreationCommandBase( EventBus = eventBus; ThemePackageAdder = themePackageAdder; AngularThemeConfigurer = angularThemeConfigurer; + CliVersionService = cliVersionService; Logger = NullLogger.Instance; } @@ -86,7 +91,7 @@ protected async Task GetProjectBuildArgsAsync(CommandLineArgs Logger.LogInformation("Preview: yes"); #if !DEBUG - var cliVersion = await CliService.GetCurrentCliVersionAsync(typeof(CliService).Assembly); + var cliVersion = await CliVersionService.GetCurrentCliVersionAsync(); if (!cliVersion.IsPrerelease) {