Treat all ProjectRefs to SharedFx projects as PrivateAssets=all#64863
Treat all ProjectRefs to SharedFx projects as PrivateAssets=all#64863
Conversation
There was a problem hiding this comment.
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 |
| <Reference Include="Microsoft.AspNetCore.Http" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
There was a problem hiding this comment.
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.
| <Reference Include="Microsoft.AspNetCore.Http" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
There was a problem hiding this comment.
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.
| <Reference Include="Microsoft.AspNetCore.Http" /> | |
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
| <Reference Include="Microsoft.AspNetCore.Http" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
There was a problem hiding this comment.
Duplicate references to "Microsoft.AspNetCore.Http" (lines 17 and 22) and "Microsoft.AspNetCore.Http.Abstractions" (lines 18 and 23) should be removed.
| <Reference Include="Microsoft.AspNetCore.Http" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
There was a problem hiding this comment.
Duplicate references to "Microsoft.AspNetCore.Http" (lines 17 and 22) and "Microsoft.AspNetCore.Http.Abstractions" (lines 18 and 23) should be removed.
| <Reference Include="Microsoft.AspNetCore.Http" /> | |
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
| <Reference Include="Microsoft.AspNetCore.Http" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
There was a problem hiding this comment.
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.
| <Reference Include="Microsoft.AspNetCore.Hosting" /> | ||
| <Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" /> | ||
| <Reference Include="Microsoft.AspNetCore.Hosting.Server.Abstractions" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
There was a problem hiding this comment.
Duplicate reference to "Microsoft.AspNetCore.Http.Abstractions" on lines 9 and 13 should be removed.
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
| <Reference Include="Microsoft.AspNetCore.Http" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> | ||
| <Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
There was a problem hiding this comment.
Duplicate reference to "Microsoft.AspNetCore.Http.Abstractions" on lines 45 and 46 should be removed.
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Results" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
There was a problem hiding this comment.
Duplicate reference to "Microsoft.AspNetCore.Http.Abstractions" on lines 15 and 17 should be removed.
| <Reference Include="Microsoft.AspNetCore.Http.Abstractions" /> |
| <Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Features" /> | ||
| <Reference Include="Microsoft.AspNetCore.Http.Results" /> | ||
| <Reference Include="Microsoft.AspNetCore.Routing.Abstractions" /> |
There was a problem hiding this comment.
Duplicate reference to "Microsoft.AspNetCore.Routing.Abstractions" on lines 9 and 19 should be removed.
| <Reference Include="Microsoft.AspNetCore.Routing.Abstractions" /> |
| <Reference Include="Microsoft.AspNetCore.Http.Results" /> | ||
| <Reference Include="Microsoft.AspNetCore.Routing.Abstractions" /> | ||
| <Reference Include="Microsoft.AspNetCore.OpenApi" /> | ||
| <Reference Include="Microsoft.AspNetCore" /> |
There was a problem hiding this comment.
The reference to "Microsoft.AspNetCore" appears to be newly added but may not be required given the other specific package references already included.
| <Reference Include="Microsoft.AspNetCore" /> |
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