Skip to content

Conversation

@wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented Dec 23, 2025

This is the way dotnet/runtime does it. Aspnetcore projects should not have any reference to SharedFx libraries in their .nuspecs. This allows us to get rid of our custom .nuspec-rewriting task, but forces us to explicitly list every required reference in every project, rather than relying on transitive references. Thanks @akoeplinger for doing much of the heavy lifting here. Required to unblock #64712

Copilot AI review requested due to automatic review settings December 23, 2025 21:02
@github-actions github-actions bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Dec 23, 2025
Copy link
Contributor

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 aligns the ASP.NET Core project reference structure with the dotnet/runtime approach by treating all SharedFx project references as PrivateAssets=all. This eliminates the need for custom .nuspec-rewriting tasks but requires explicitly listing every required reference in each project file instead of relying on transitive references.

Key Changes:

  • Removed reliance on transitive references from SharedFx libraries
  • Added explicit references to all required ASP.NET Core packages in project files
  • Ensured SharedFx libraries won't appear in NuGet package dependencies

Reviewed changes

Copilot reviewed 296 out of 403 changed files in this pull request and generated 60 comments.

Show a summary per file
File Description
Authentication project files Added explicit references to core authentication, HTTP, and abstractions packages
MVC test websites and projects Added comprehensive references to MVC, Razor, routing, hosting, and server packages
OpenAPI projects Added extensive HTTP, hosting, MVC, and server infrastructure references
Middleware projects Added routing, hosting, HTTP abstractions, and feature packages
Identity projects Added authentication, authorization, MVC, and data protection package references
Razor projects Added HTML abstractions, hosting, HTTP, and hosting server packages
Routing and HTTP projects Added abstractions and feature packages for HTTP and routing
Sample and test projects Added comprehensive package references for hosting, HTTP, routing, and server components
Grpc interop helpers Fixed initialization order and added error handling for startup failures
JsonPatch tests Added conditional references for framework compatibility

Comment on lines +16 to +17
<Reference Include="Microsoft.AspNetCore.Http" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Duplicate references to "Microsoft.AspNetCore.Http" (lines 16 and 21) and "Microsoft.AspNetCore.Http.Abstractions" (lines 17 and 22) should be removed to avoid redundancy.

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +22
<Reference Include="Microsoft.AspNetCore.Http" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Duplicate references to "Microsoft.AspNetCore.Http" (lines 16 and 21) and "Microsoft.AspNetCore.Http.Abstractions" (lines 17 and 22) should be removed to avoid redundancy.

Suggested change
<Reference Include="Microsoft.AspNetCore.Http" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +18
<Reference Include="Microsoft.AspNetCore.Http" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Duplicate references to "Microsoft.AspNetCore.Http" (lines 17 and 22) and "Microsoft.AspNetCore.Http.Abstractions" (lines 18 and 23) should be removed.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +23
<Reference Include="Microsoft.AspNetCore.Http" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Duplicate references to "Microsoft.AspNetCore.Http" (lines 17 and 22) and "Microsoft.AspNetCore.Http.Abstractions" (lines 18 and 23) should be removed.

Suggested change
<Reference Include="Microsoft.AspNetCore.Http" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +16
<Reference Include="Microsoft.AspNetCore.Http" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Duplicate references to "Microsoft.AspNetCore.Http" (lines 15 and 22), "Microsoft.AspNetCore.Http.Abstractions" (lines 16 and 23), and "Microsoft.AspNetCore.HttpOverrides" (lines 18 and 25) should be removed.

Copilot uses AI. Check for mistakes.
<Reference Include="Microsoft.AspNetCore.Hosting" />
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
<Reference Include="Microsoft.AspNetCore.Hosting.Server.Abstractions" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Duplicate reference to "Microsoft.AspNetCore.Http.Abstractions" on lines 9 and 13 should be removed.

Suggested change
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />

Copilot uses AI. Check for mistakes.
<Reference Include="Microsoft.AspNetCore.Http" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Duplicate reference to "Microsoft.AspNetCore.Http.Abstractions" on lines 45 and 46 should be removed.

Suggested change
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />

Copilot uses AI. Check for mistakes.
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
<Reference Include="Microsoft.AspNetCore.Http" />
<Reference Include="Microsoft.AspNetCore.Http.Results" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Duplicate reference to "Microsoft.AspNetCore.Http.Abstractions" on lines 15 and 17 should be removed.

Suggested change
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />

Copilot uses AI. Check for mistakes.
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
<Reference Include="Microsoft.AspNetCore.Http.Features" />
<Reference Include="Microsoft.AspNetCore.Http.Results" />
<Reference Include="Microsoft.AspNetCore.Routing.Abstractions" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Duplicate reference to "Microsoft.AspNetCore.Routing.Abstractions" on lines 9 and 19 should be removed.

Suggested change
<Reference Include="Microsoft.AspNetCore.Routing.Abstractions" />

Copilot uses AI. Check for mistakes.
<Reference Include="Microsoft.AspNetCore.Http.Results" />
<Reference Include="Microsoft.AspNetCore.Routing.Abstractions" />
<Reference Include="Microsoft.AspNetCore.OpenApi" />
<Reference Include="Microsoft.AspNetCore" />
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The reference to "Microsoft.AspNetCore" appears to be newly added but may not be required given the other specific package references already included.

Suggested change
<Reference Include="Microsoft.AspNetCore" />

Copilot uses AI. Check for mistakes.
@wtgodbe wtgodbe merged commit f33887d into main Dec 24, 2025
25 checks passed
@wtgodbe wtgodbe deleted the wtgodbe/SharedFxRefs branch December 24, 2025 18:10
@dotnet-policy-service dotnet-policy-service bot added this to the 11.0-preview1 milestone Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants