From 6899607b574817d00d9833ccb9ac14468ca99db8 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 16 May 2024 14:10:46 +0800 Subject: [PATCH] Update bundle command warning message. --- .../Volo/Abp/Cli/Bundling/BundlingService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs index d0a6698209..76bc82f570 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs @@ -345,14 +345,15 @@ public class BundlingService : IBundlingService, ITransientDependency break; } - var targetFramework = document.SelectSingleNode("//TargetFramework")?.InnerText; + var targetFramework = document.SelectSingleNode("//TargetFramework")?.InnerText ?? + document.SelectNodes("//TargetFrameworks")[0].InnerText; var currentCliVersion = await CliVersionService.GetCurrentCliVersionAsync(); if (targetFramework.IsNullOrWhiteSpace() || - !targetFramework.StartsWith($"net{currentCliVersion.Major}", StringComparison.OrdinalIgnoreCase)) + targetFramework.IndexOf($"net{currentCliVersion.Major}.0", StringComparison.OrdinalIgnoreCase) < 0) { - throw new BundlingException($"Your project target framework is {targetFramework}. " + Environment.NewLine + - $"ABP CLI version is {currentCliVersion}. " + Environment.NewLine + + throw new BundlingException($"Your project({projectFilePath}) target framework is {targetFramework}. " + Environment.NewLine + + $"But ABP CLI version is {currentCliVersion}. " + Environment.NewLine + $"Please use the ABP CLI that is compatible with your project target framework."); } }