SimplCommerce icon indicating copy to clipboard operation
SimplCommerce copied to clipboard

Deployment to Azure AppServices with Production Environment makes all js files to fail

Open luis-cortina opened this issue 5 years ago • 1 comments

When I deploy this or even locally changed the ASPNETCORE_ENVIRONMENT Variable to something other than Development, I start getting 404 errors for all my js files:

info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://localhost:49206/_content/SimplCommerce.Module.Vendors/admin/vendors/vendor-form.js?v=1.0
dbug: Microsoft.AspNetCore.HttpsPolicy.HstsMiddleware[2]
      The host 'localhost' is excluded. Skipping HSTS header.
dbug: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[5]
      The request path /_content/SimplCommerce.Module.Vendors/admin/vendors/vendor-form.js does not match an existing file
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1001]
      1 candidate(s) found for the request path '/_content/SimplCommerce.Module.Vendors/admin/vendors/vendor-form.js'
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1005]
      Endpoint '/{**slug}' with route pattern '/{**slug}' is valid for the request path '/_content/SimplCommerce.Module.Vendors/admin/vendors/vendor-form.js'

All files are now located directly under the wwwroot folder.

Any help on this?

Luis

luis-cortina avatar Aug 21 '20 03:08 luis-cortina

Late reply, but if anyone else faces the same issue, add builder.WebHost.UseStaticWebAssets(); on Program.cs file.

mirivhbv avatar Dec 02 '23 09:12 mirivhbv