SimplCommerce
SimplCommerce copied to clipboard
Deployment to Azure AppServices with Production Environment makes all js files to fail
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
Late reply, but if anyone else faces the same issue, add builder.WebHost.UseStaticWebAssets(); on Program.cs file.