Browse Source

Create `staticwebassets.endpoints.json` if it doesn't exist.

pull/21784/head
maliming 1 year ago
parent
commit
901021e40f
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 7
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs

7
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<IOptions<AbpAspNetCoreContentOptions>>().Value;

Loading…
Cancel
Save