From dc8f7a8c3ef80987b3eead66f99f81c7fe907910 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 9 May 2024 16:02:52 +0800 Subject: [PATCH 1/2] Compatible with `app-nolayers`. --- .../Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 7795493fea..7dffd35d50 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 @@ -107,7 +107,8 @@ public class BundlingService : IBundlingService, ITransientDependency if (!bundleConfig.InteractiveAuto) { var fileName = bundleConfig.IsBlazorWebApp - ? Directory.GetFiles(Path.GetDirectoryName(projectFilePath)!.Replace(".Client", ""), "App.razor", SearchOption.AllDirectories).FirstOrDefault() + ? Directory.GetFiles(Path.GetDirectoryName(projectFilePath)!.Replace(".Client", ""), "App.razor", SearchOption.AllDirectories).FirstOrDefault() ?? + Directory.GetFiles(Path.GetDirectoryName(projectFilePath)!.Replace(".Blazor", ".Host"), "App.razor", SearchOption.AllDirectories).FirstOrDefault() : Path.Combine(PathHelper.GetWwwRootPath(directory), "index.html"); await UpdateDependenciesInBlazorFileAsync(fileName, styleDefinitions, scriptDefinitions); From 8d25ce4770bec56b8b9ec1ca6c703c4ff6ef832a Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 9 May 2024 16:06:26 +0800 Subject: [PATCH 2/2] Update BundlingService.cs --- .../Volo/Abp/Cli/Bundling/BundlingService.cs | 5 +++++ 1 file changed, 5 insertions(+) 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 7dffd35d50..ecbc0d2e9c 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 @@ -111,6 +111,11 @@ public class BundlingService : IBundlingService, ITransientDependency Directory.GetFiles(Path.GetDirectoryName(projectFilePath)!.Replace(".Blazor", ".Host"), "App.razor", SearchOption.AllDirectories).FirstOrDefault() : Path.Combine(PathHelper.GetWwwRootPath(directory), "index.html"); + if (fileName == null) + { + throw new BundlingException($"App.razor file could not be found in the {projectFilePath} directory."); + } + await UpdateDependenciesInBlazorFileAsync(fileName, styleDefinitions, scriptDefinitions); Logger.LogInformation($"Script and style references in the {fileName} file have been updated.");