From b0054284c2873c9c05d0c72c49e9553ab4d66aab Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 14 Feb 2025 11:20:32 +0800 Subject: [PATCH] fix: fix cli --- .../FodyWeavers.xml | 3 --- .../cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj | 2 +- .../LINGYUN/Abp/Cli/Commands/HelpCommand.cs | 11 ++++++----- 3 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.IP.Location/FodyWeavers.xml diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.IP.Location/FodyWeavers.xml b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.IP.Location/FodyWeavers.xml deleted file mode 100644 index 1715698cc..000000000 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.IP.Location/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj index 7ea7a8cd3..6176a8657 100644 --- a/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj +++ b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj @@ -5,7 +5,7 @@ Exe net9.0 - 8.3.0 + 9.0.4 colin Use LINGYUN.MicroService.Templates command line true diff --git a/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/Commands/HelpCommand.cs b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/Commands/HelpCommand.cs index ea1416767..8d9906a3e 100644 --- a/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/Commands/HelpCommand.cs +++ b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/Commands/HelpCommand.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using Volo.Abp.Cli; @@ -70,14 +71,14 @@ namespace LINGYUN.Abp.Cli.Commands foreach (var command in AbpCliOptions.Commands.ToArray()) { - string shortDescription; - - using (var scope = ServiceScopeFactory.CreateScope()) + var method = command.Value.GetMethod("GetShortDescription", BindingFlags.Static | BindingFlags.Public); + if (method == null) { - shortDescription = ((IConsoleCommand)scope.ServiceProvider - .GetRequiredService(command.Value)).GetShortDescription(); + continue; } + var shortDescription = (string)method.Invoke(null, null); + sb.Append(" > "); sb.Append(command.Key); sb.Append(string.IsNullOrWhiteSpace(shortDescription) ? "" : ":");