Refused to apply style from 'https://localhost:44314/App.styles.css' because its MIME type ('') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Raj
648
Points
26
Posts
Getting following error and css not getting loaded in local when env. set to qa:
Refused to apply style from 'https://localhost:44314/App.styles.css' because its MIME type ('') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Anyone has any clue?
Note: It's working fine when debugging with development env.
When running the consuming app from build output (dotnet run), static web assets are enabled by default in the Development environment. To support assets in other environments when running from build output, call UseStaticWebAssets on the host builder in Program.cs:
using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting;
public class Program { public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); }