From 901021e40f01a4aaa00af2c7293ab37299e44880 Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 1 Jan 2025 13:47:21 +0800 Subject: [PATCH] Create `staticwebassets.endpoints.json` if it doesn't exist. --- .../AspNetCore/Builder/AbpApplicationBuilderExtensions.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs index 2dbd73a3ee..cfd7eb515b 100644 --- a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs @@ -183,7 +183,12 @@ public static class AbpApplicationBuilderExtensions app.UseStaticFiles(); // Volo.Abp.AspNetCore.staticwebassets.endpoints.json is a empty file. // https://github.com/dotnet/aspnetcore/issues/59673 - return endpoints.MapStaticAssets("Volo.Abp.AspNetCore.staticwebassets.endpoints.json"); + var tempStaticAssetsManifestPath = Path.Combine(AppContext.BaseDirectory, "Volo.Abp.AspNetCore.staticwebassets.endpoints.json"); + if (!File.Exists(tempStaticAssetsManifestPath)) + { + File.WriteAllText(tempStaticAssetsManifestPath, "{\"Version\":1,\"ManifestType\":\"Build\",\"Endpoints\":[]}"); + } + return endpoints.MapStaticAssets(tempStaticAssetsManifestPath); } var options = app.ApplicationServices.GetRequiredService>().Value;