Monday, January 17, 2011

Chrome "Resource interpreted as stylesheet but transferred with MIME type text/plain."

Chrome (8.0.522.237) isn't rendering a linked CSS file from an ASP.NET WebResource.axd (an embedded resource).

The following warning appears in Developer Tools - Resources:

Resource interpreted as stylesheet but transferred with MIME type text/plain.

In this case the issue was with the WebResource reference in the AssemblyInfo.cs

[assembly: WebResource("SampleNamespace.SampleCss.css", "text-css", PerformSubstitution = true)]

Should have been:

[assembly: WebResource("SampleNamespace.SampleCss.css", "text/css", PerformSubstitution = true)]