Skip to content

Disable compression in Microsoft.AspNetCore.App.Internal.Assets - #67545

Merged
javiercn merged 1 commit into
mainfrom
copilot/disable-compression-static-web-assets
Jul 4, 2026
Merged

javiercn merged 1 commit into
mainfrom
copilot/disable-compression-static-web-assets

Conversation

Copilot AI commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Set <CompressionEnabled>false</CompressionEnabled> in Microsoft.AspNetCore.App.Internal.Assets.csproj to fix a race condition where parallel consumer publishes all invoke this project's publish-compression targets against the same shared obj/compressed/publish dir, causing intermittent "file is being used by another process" failures.

Description

  • CompressionEnabled=false prevents Microsoft.NET.Sdk.StaticWebAssets.Compression.targets from being imported in this library project — no compression targets run, no shared-dir contention.
  • Consuming root apps have StaticWebAssetPublishCompressAllAssets=true, so they compress all static web assets (including these framework JS files) in their own isolated $(IntermediateOutputPath)compressed\publish dirs. No performance regression.
  • Same pattern already used by Microsoft.AspNetCore.Components.WebView (src/Components/WebView/WebView/src/StaticWebAssets.Groups.targets).

Alternative to #67500.

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

@javiercn javiercn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javiercn
javiercn marked this pull request as ready for review July 1, 2026 19:18
Copilot AI review requested due to automatic review settings July 1, 2026 19:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Disables static web assets publish-compression for the Microsoft.AspNetCore.App.Internal.Assets package to avoid intermittent file-lock/race failures when multiple consumer apps publish in parallel and all invoke compression targets against the same shared obj/compressed/publish directory.

Changes:

  • Set CompressionEnabled=false in Microsoft.AspNetCore.App.Internal.Assets.csproj to prevent static web asset publish-compression targets from running in this producer project.
  • Add an explanatory comment describing the parallel publish race and why compression should be performed by consuming root apps instead.

@javiercn
javiercn force-pushed the copilot/disable-compression-static-web-assets branch from 0d19e19 to d808add Compare July 3, 2026 20:56
@javiercn
javiercn merged commit dfb0b04 into main Jul 4, 2026
25 checks passed
@javiercn
javiercn deleted the copilot/disable-compression-static-web-assets branch July 4, 2026 13:24
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 6, 2026
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.

4 participants