Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 22, 2025

Fix ETag header not found error for compressed resources in Release builds

Description

When running ASP.NET Core applications with compressed static web assets in Release configuration, the runtime throws an InvalidOperationException with message "ETag header not found".

We removed the additional ETag in production because some servers experience issues with it. For development, we switched to emit the ETag only in the Debug configuration.

The runtime however depended on the ETag being present for development scenarios and when we removed it, it started causing issues with dotnet run -c Release.

The fix removes the usage of weak ETags for .NET 10.0 and onwards, replacing it with an original-resource endpoint property. The SDK will continue to emit weak ETags for .NET 9.0 for backwards compatibility.

Fixes #63364

Customer Impact

Users running ASP.NET Core applications with dotnet run -c Release serving static files will encounter this error.

This blocks development scenarios where developers test Release builds locally without publishing. The error prevents the application from starting properly.

Workarounds:

  • Run in Debug configuration
  • Publish the app instead of just building it
  • Disable the development helper for "hot reloading" assets.

Regression?

  • Yes
  • No

9.0

Risk

  • High
  • Medium
  • Low

We continue to Emit the ETags for .NET 9.0 while using the new property-based approach for .NET 10.0+.

Verification

  • Manual (required)
  • Automated

Manual testing: Verified that ASP.NET Core apps run successfully with the new property based approach.

Automated tests: Updated existing tests and added new test coverage for the property-based approach.

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@wtgodbe
Copy link
Member

wtgodbe commented Aug 22, 2025

@javiercn rc1 is locked down, this should be redirected to release/10.0

@javiercn javiercn closed this Aug 23, 2025
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-rc1 milestone Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants