Skip to content

Error when loading test.html using MapStaticAssets: Failed to load resource: net::ERR_CONTENT_DECODING_FAILED #58940

Open
@danroth27

Description

@danroth27

Repro steps:

  • Create an empty ASP.NET Core app
  • Add app.MapStaticAssets()
  • Add wwwroot/test.html
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <h1>Test</h1>
</body>
</html>

Run the app and browser to /test.html

Expected result: test.html renders in the browser

Actual result: Failed to load resource: net::ERR_CONTENT_DECODING_FAILED

Workarounds:

  • Swap app.MapStaticAssets() for app.UseStaticFiles()
  • Use a .json file instead of a .html file

Metadata

Metadata

Assignees

Labels

ExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.area-ui-renderingIncludes: MVC Views/Pages, Razor Views/Pagesfeature-static-web-assets

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions