skoruba/IdentityServer4.Admin

IDS.Admin project CSS not loading giving error

1-Finance opened this issue · 1 comments

Describe the bug

Identity Server Admin Application gives error when we set ASPNETCORE_ENVIRONMENT variable other than Development.

It gives 404 error for path ==> https://localhost:44303/dist/js/bundle.min.js

To Reproduce

Steps to reproduce the behavior:

  1. Create a appsettings.otherthandev.json
  2. Run STS, API and ADMIN apps
  3. Open ADMIN in browser

Relevant parts of the log file

image

image

<log goes here>

It is resolved. If we want to serve the static assets from the nuget library then we need to add

webBuilder.UseStaticWebAssets();

inside

.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.ConfigureKestrel(options => options.AddServerHeader = false);

                webBuilder.UseStartup<Startup>();
            })