Skip to content

ensure that Content items are available during restore to un-break Razor #49783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2025

Conversation

baronfel
Copy link
Member

Fixes https://github.com/dotnet/AspNetCore-ManualTests/issues/3701

We accidentally disabled all default items for review - I intended to only disable Content, Compile, EmbeddedResource, and None.

However, disabling Content items breaks Razor, who include an additional implicit PackageReference when .razor Content items are found.

@Copilot Copilot AI review requested due to automatic review settings July 15, 2025 14:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a restore optimization issue where all default items were accidentally disabled, breaking Razor functionality. The fix ensures that Content items remain available during restore operations while still disabling other unnecessary default items for performance optimization.

  • Changed from disabling all default items to selectively disabling only Compile, EmbeddedResource, and None items
  • Added new constant for EnableDefaultContentItems to support granular control
  • Updated restore optimization properties to preserve Content items needed by Razor

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Cli/dotnet/Commands/Restore/RestoringCommand.cs Updated restore optimization to selectively disable default items instead of all items, with explanatory comment
src/Cli/Microsoft.DotNet.Cli.Utils/Constants.cs Added EnableDefaultContentItems constant for granular default item control

@baronfel baronfel enabled auto-merge (squash) July 15, 2025 14:47
@baronfel baronfel force-pushed the allow-content-during-restore branch from c6c2c8b to 20ef9dc Compare July 15, 2025 22:05
@baronfel baronfel merged commit 806e650 into dotnet:main Jul 16, 2025
27 checks passed
@baronfel baronfel deleted the allow-content-during-restore branch July 16, 2025 01:45
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.

3 participants